Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by mtthompsons
at 2024-07-22 21:18:25
Point:500 Replies:18 POST_ID:829078USER_ID:11979
Topic:
Microsoft Excel Spreadsheet Software;;
Hi All,
Attached file is a sample. I have the URL's in Column "C" which are of images. I want help with a macro that can check the URL and fetch the images and paste into column "D"
Can anyone help me please as i have 100's to be gathered
Thanks
Attached file is a sample. I have the URL's in Column "C" which are of images. I want help with a macro that can check the URL and fetch the images and paste into column "D"
Can anyone help me please as i have 100's to be gathered
Thanks
Attachment:Sample.xls
Author: mtthompsons replied at 2024-07-23 05:10:15
Pictures can never be placed in a cell, the picture layer is a separate layer. You can place an image over a cell which I believe Duncan is doing (I didn't check any of his samples).
Check the attached file, in column D the image is inserted in a comment and in column E the image is placed over the cell.
Look at the formulas in columns D & E to see how it works. It is possible if you want to create a macro that will insert the images instead of manually inserting formulas.
Check the attached file, in column D the image is inserted in a comment and in column E the image is placed over the cell.
Look at the formulas in columns D & E to see how it works. It is possible if you want to create a macro that will insert the images instead of manually inserting formulas.
Attachment:Sample.xls
Assisted Solution
Expert: MacroShadow replied at 2024-07-23 04:46:39
100 points EXCELLENT
Pictures can never be placed in a cell, the picture layer is a separate layer. You can place an image over a cell which I believe Duncan is doing (I didn't check any of his samples).
Check the attached file, in column D the image is inserted in a comment and in column E the image is placed over the cell.
Look at the formulas in columns D & E to see how it works. It is possible if you want to create a macro that will insert the images instead of manually inserting formulas.
Check the attached file, in column D the image is inserted in a comment and in column E the image is placed over the cell.
Look at the formulas in columns D & E to see how it works. It is possible if you want to create a macro that will insert the images instead of manually inserting formulas.
Attachment:Sample.xls
Accepted Solution
Expert: duncanb7 replied at 2024-07-23 04:18:25
400 points EXCELLENT
see the attachment and run macro
Duncan
Duncan
Expert: duncanb7 replied at 2024-07-23 03:18:57
I am downloading Excel 2007, please wait since it is expired
Duncan
Duncan
Author: mtthompsons replied at 2024-07-23 03:15:51
yes i am using 2007
Expert: duncanb7 replied at 2024-07-23 03:12:02
probaby it is Excel version issue , I am using 2003
you are using 2007 or above, right ?
you are using 2007 or above, right ?
Author: mtthompsons replied at 2024-07-23 03:05:04
Thanks
Everything works fine
its just that it copies all images on each other and not d column
Please see the attachment
Everything works fine
its just that it copies all images on each other and not d column
Please see the attachment
Expert: duncanb7 replied at 2024-07-23 02:39:22
Please read it, Tutorial for Excel VBA for activate and select at
http://msdn.microsoft.com/en-us/library/office/aa221576(v=office.11).aspx
http://msdn.microsoft.com/en-us/library/office/aa221576(v=office.11).aspx
Expert: duncanb7 replied at 2024-07-23 02:33:03
just run the attachment , by click atl-F11 go to VBA on Excel and run test() macro and no need to do any select( it is already done for you).
review all my previous post and think about each code function
Duncan
review all my previous post and think about each code function
Duncan
Author: mtthompsons replied at 2024-07-23 01:15:10
I ran the macro called Test and selected sheet 1 column "D" but all images are being collected but all one over the other in column "A"
Expert: duncanb7 replied at 2024-07-23 00:35:14
I work because I click the Range("D1') in sheet1 before macro start to run
Duncan
Duncan
Expert: duncanb7 replied at 2024-07-23 00:34:04
it might be you did not select sheet and cell so that there is not Activate
put those two code into test()
ActiveWorkbook.Sheets("sheet1").Activate
ActiveWorkbook.Sheets("sheet1").Range("D1").Select
Duncan
put those two code into test()
ActiveWorkbook.Sheets("sheet1").Activate
ActiveWorkbook.Sheets("sheet1").Range("D1").Select
Duncan
Sub test()Dim tmp, i As IntegerDim slocalfile As String'Delete all imageDim Pic As ObjectFor Each Pic In ActiveSheet.PicturesPic.DeleteNext PicActiveWorkbook.Sheets("sheet1").ActivateActiveWorkbook.Sheets("sheet1").Range("D1").Select'import imagetmp = Range(Range("C1"), Range("C65535").End(xlUp)).CountDebug.Print "Starting loading and importing image"For i = 1 To tmpDebug.Print Cells(i, 3).Valueslocalfile = "C: emp" & i & ".png"Call URLDownloadToFile(0&, Cells(i, 3).Value, slocalfile, 0&, 0&) Cells(i, 4).Select Selection.ClearContents ActiveSheet.Pictures.Insert(slocalfile).SelectNext iEnd Sub 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:
Author: mtthompsons replied at 2024-07-23 00:26:18
I get the item with the specified name is not found
I do have a folder called temp in C Drive
When debug goes to this line
ActiveSheet.Shapes("Picture 1").Select
I do have a folder called temp in C Drive
When debug goes to this line
ActiveSheet.Shapes("Picture 1").Select
Expert: duncanb7 replied at 2024-07-22 23:30:14
Please review the code , you also need to know what is doing on each code
Duncan
Duncan
Expert: duncanb7 replied at 2024-07-22 23:27:16
Already done that, please check the attachment
Just run test() sub in macro1
Duncan
Just run test() sub in macro1
Duncan
Author: mtthompsons replied at 2024-07-22 23:06:07
I want the images into the excel in Column "D" not just download to a drive
Will this code do that?
Will this code do that?
Expert: duncanb7 replied at 2024-07-22 22:27:04
be reminded you need to have c: emp directory to save the image locally, otherwise change it to other directory you want on VBA
Duncan
Duncan
Expert: duncanb7 replied at 2024-07-22 22:13:47
You need download function URLDownloadToFile on vba to do,
run the macro1 test() as follows, and save image files at C; emp
Hope understand your question.if not, please point it out
Duncan
run the macro1 test() as follows, and save image files at C; emp
Hope understand your question.if not, please point it out
Duncan
Private Declare Function URLDownloadToFile Lib "urlmon" _Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, _ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As LongPrivate Const ERROR_SUCCESS As Long = 0Sub test()Dim tmp, i As IntegerDim slocalfile As String'Delete all imageDim Pic As ObjectFor Each Pic In ActiveSheet.PicturesPic.DeleteNext Pic'import imagetmp = Range(Range("C1"), Range("C65535").End(xlUp)).CountDebug.Print "Starting loading and importing image"For i = 1 To tmpDebug.Print Cells(i, 3).Valueslocalfile = "C: empc" & i & ".png"Call URLDownloadToFile(0&, Cells(i, 3).Value, slocalfile, 0&, 0&) Cells(i, 4).Select Selection.ClearContents ActiveSheet.Pictures.Insert(slocalfile).SelectNext iEnd Sub 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32: