Google Answers Logo
View Question
 
Q: Excel spreadsheet question ( Answered 4 out of 5 stars,   0 Comments )
Question  
Subject: Excel spreadsheet question
Category: Computers > Software
Asked by: morganm-ga
List Price: $7.00
Posted: 31 Mar 2004 15:08 PST
Expires: 30 Apr 2004 16:08 PDT
Question ID: 323194
For Maniac-ga
I need you to post an answer to my last question so you can get paid!
Regards
Morganm
Answer  
Subject: Re: Excel spreadsheet question
Answered By: maniac-ga on 31 Mar 2004 16:59 PST
Rated:4 out of 5 stars
 
Hello again Morganm,

I would be glad to.

I have divided the macro into two parts:
 - UpdateSheet will be the macro you assign to a button, updating the
entire sheet. You can add as many Call statements to UpdateSheet as
needed to handle all the value cells / image destinations.
 - InsertPict will remove any previous image then paste, locate &
rename the image file referenced

Copy / paste the new macro just like the previous answer described.
Make any changes you need (or try the simple one first - then fix it).
Once done, return to Excel to create the button / run the macro.

You can assign this macro to a button on the spreadsheet with the following steps.
[1] Tools -> Customize will bring up a dialog box with two tabs. Make
sure the Toolbar tab is selected and that the Forms line has a
checkmark. Select OK to bring up the toolbar.
[2] Select the "button" shaped item on the toolbar (it is the right
side of second row on my copy of Excel).
[3] Click and drag across the area you want to add the button. On my
system it came up with the name Button13_Click, but we'll fix that
shortly. You should get a dialog box asking which macro you want to
assign to the Button. Select UpdateSheet and OK.
[4] Double click inside the button to select its name and change it to
something appropriate. I made it "Update" on my copy.
[5] While it looks like a relocatable object, you can resize it / move
it around just like any other image. When done - click outside the
button and it will now be active.

Click on the button and the macro should run and do the image updates.

Use a clarification request to let me know if you have any problems
with this macro or need any additional explanation.

  --Maniac

'
' UpdateSheet Macro
' Macro created 3/31/2004 by Maniac
'
Sub UpdateSheet()
    Call InsertPict("$B$1", "$J$1")
End Sub


Sub InsertPict(CellRef$, DestRef$)
'
' InsertPict Macro
' Macro recorded 3/29/2004 by Maniac
'

' Disable errors
' Attempt to delete any existing shape with the same name
    On Error Resume Next
    ActiveSheet.Shapes(DestRef$).Delete
    On Error GoTo 0
' error processing now enabled again
    ActiveSheet.Pictures.Insert(Range(CellRef$).Value).Select
    Selection.ShapeRange.Left = Range(DestRef$).Left
    Selection.ShapeRange.Top = Range(DestRef$).Top
    Selection.ShapeRange.Name = DestRef$
End Sub
morganm-ga rated this answer:4 out of 5 stars and gave an additional tip of: $5.00
This was my first experience with Google Answers.  I am most satisfied!

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy