-
Jul 27th, 2014, 01:56 PM
#1
Thread Starter
PowerPoster
INSERT icon from c:\mydir... in cell
I have a icon (gif) in c:\mydir\icons\ico1.gif
i need to insert this icon to the right of this value similar:
ws.Range("AG" & RIGA1).Value = Format(SDO, "#,##0.00")& " "& c:\mydir\icons\ico1.gif
how to via vba code?
Tks.
-
Jul 28th, 2014, 07:44 AM
#2
Re: INSERT icon from c:\mydir... in cell
as excel would see the formatted string as numeric, therefore right aligned in the cell, the icon would need to be in the next column?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jul 28th, 2014, 08:16 AM
#3
Thread Starter
PowerPoster
Re: INSERT icon from c:\mydir... in cell
Originally Posted by westconn1
as excel would see the formatted string as numeric, therefore right aligned in the cell, the icon would need to be in the next column?
No.
i have posted a number range but i rially use a string not number....
But is really possible to insert to right of string in the same cell a icon from path?
Tks.
-
Jul 28th, 2014, 08:27 AM
#4
Re: INSERT icon from c:\mydir... in cell
Can you perform the operation manually?
If so, turn on Marco Recording, perform the action, then stop recording. You should then be able to go look at the macro, see the VBA code it generated... based on that you should then be able to adapt it to your needs.
-tg
-
Jul 28th, 2014, 08:32 AM
#5
Thread Starter
PowerPoster
Re: INSERT icon from c:\mydir... in cell
Originally Posted by techgnome
Can you perform the operation manually?
If so, turn on Marco Recording, perform the action, then stop recording. You should then be able to go look at the macro, see the VBA code it generated... based on that you should then be able to adapt it to your needs.
-tg
hummmmmmm....
i need to loop 8.458 lines, and insert in the existing value of cells the icon on the right.!
-
Jul 28th, 2014, 08:48 AM
#6
Re: INSERT icon from c:\mydir... in cell
That's not quite what I had in mind... I figured you would do it ONCE... see how Excel does it in a macro... then ADAPT that code to your needs... such as putting it in a loop, etc...
-tg
-
Jul 28th, 2014, 04:41 PM
#7
Re: INSERT icon from c:\mydir... in cell
But is really possible to insert to right of string in the same cell a icon from path?
i do not believe so, but it should be possible to position an image over a cell so that it appears as if it is
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|