Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default How can I locate image code in a worksheet object

Dear all

I have checked the archives for a solution to this and have drawn a
blank.

I have an image "shpTrend" to which I want to attach the following
code:

Sub shpTrend_Click()

ThisWorkbook.ActiveSheet.Names("dKESelection").Ref ersToRange.Value =
"Trend uplift / downgrade"
Application.GoTo Reference:="dTrendUplift"

End Sub

This image, and the ranges "dTrendUplift" and "dKESelection" are
replicated on multiple worksheets and I want the code to use the
versions of the ranges that are in the same sheet as the image that
has been clicked.

The most efficient way of doing this, I believe, is to create the
image using control toolbox, and then replicate the code in each of
the relevant worksheet objects in visual basic. However, the image I
want to use already exists and took a long time to create (i.e.
draw). If there is a way of getting an existing image to be
controlled like a control toolbox image then this would save me a lot
of time.

Hopefully somebody can help with this.

Thanks

JT
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 434
Default How can I locate image code in a worksheet object

hi, !

(i guess...) you could try a macro to assign a macro to your shape-object
(i.e.) looping through every worksheet with an instruction like...

ActiveSheet.Shapes("shpTrend").OnAction = "shpTrend_Click"

hth,
hector.

__ OP __
I have checked the archives for a solution to this and have drawn a blank.
I have an image "shpTrend" to which I want to attach the following code:
Sub shpTrend_Click()
ThisWorkbook.ActiveSheet.Names("dKESelection").Ref ersToRange.Value = "Trend uplift / downgrade"
Application.GoTo Reference:="dTrendUplift"
End Sub
This image, and the ranges "dTrendUplift" and "dKESelection" arereplicated on multiple worksheets
and I want the code to use the versions of the ranges that are in the same sheet as the image that has been clicked.
The most efficient way of doing this, I believe, is to create the image using control toolbox
and then replicate the code in each of the relevant worksheet objects in visual basic.
However, the image I want to use already exists and took a long time to create (i.e. draw).
If there is a way of getting an existing image to be controlled like a control toolbox image then this would save me a lot time.
Hopefully somebody can help with this...



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto_open from Worksheet Object Code Stuart[_2_] Excel Programming 1 October 19th 07 08:00 PM
VB Code Help - locate and sum Stan Excel Discussion (Misc queries) 4 April 25th 07 05:33 PM
Attach object (eg image) to worksheet usadream[_6_] Excel Programming 3 March 27th 06 04:08 PM
Hyperlink to an image in other worksheet, displaying entire image. twilliams Excel Worksheet Functions 0 February 7th 06 10:02 PM
Export the worksheet background image as an image file - possible? DataFreakFromUtah Excel Programming 2 April 10th 04 04:49 PM


All times are GMT +1. The time now is 04:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"