Morning All
I am wanting to automatically insert a graphic file (jpg) into an excel document, but have it appear on multiple sheets. The closest Macro i could find was from
http://www.mcgimpsey.com/excel/lookuppics.html
but that only works for 1 cell on 1 sheet... macro for above is :
Any advise or help you could offer would be greatly appreciated!Private Sub Worksheet_Calculate() Dim oPic As Picture Me.Pictures.Visible = False With Range("F1") For Each oPic In Me.Pictures If oPic.Name = .Text Then oPic.Visible = True oPic.Top = .Top oPic.Left = .Left Exit For End If Next oPic End With End Sub
Last edited by mgreen; 08-12-2009 at 06:27 AM.
Hi, This will Place a Picture from file on each Sheet in WorkBook.
Change Path, Picture Name, Ranges to Suit.
Regards MickSub MG12Aug03 Dim Pth As String, Pic As String, Fpth As String, Sht As Worksheet Application.ScreenUpdating = False Pic = "MyPic" 'Picture Name and File Path Below Pth = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\" Fpth = Pth & Pic & ".jpg" For Each Sht In ActiveWorkbook.Worksheets Sht.Select ActiveSheet.Pictures.Insert(Fpth).Select With Selection .Height = 100 .Width = 200 .top = Range("z1").top .Left = Range("z1").Left End With Next Sht Application.ScreenUpdating = True End Sub
Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks