Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Macro to take cell ref of the object

Hi,

Say I have objects placed in Col c, d, e, f, g, h, i, j in row 8 and I need
to assign macro for each object such that

when I click on object which is in d8, then it should copy the value of d7
and paste in may be a1

when I click on object which is in e8, then it should copy the value of e7
and paste in may be a1 again.. and so on..

can anyone help me with this pls..

Thanks..
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Macro to take cell ref of the object

What type of object do you have?

You need to go into design mode to assign a macro to an object

from worksheet menu

View - Tool Bars - Control toolbox, then click on triangle ICON enter design
mode.

Then either (depends on object)
1) Right click object and select Assign Macro. Then press New
2) Double click on Object which will automatically create the macro.

Next, enter the copy line (2nd line) from code below into the macro that was
created by excel.


Sub Picture2_Click()
Range("A1").Value = Range("D7").Value
End Sub


Finally, exit design mode by clicking on Triangular Icon in the toolbar.

"Kashyap" wrote:

Hi,

Say I have objects placed in Col c, d, e, f, g, h, i, j in row 8 and I need
to assign macro for each object such that

when I click on object which is in d8, then it should copy the value of d7
and paste in may be a1

when I click on object which is in e8, then it should copy the value of e7
and paste in may be a1 again.. and so on..

can anyone help me with this pls..

Thanks..

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Macro to take cell ref of the object

Hi Joel,

Actually I'm using transparent object (used for hyperlinking) its not
working..

I even tried the way you said, still its not working..

If thismobject is placed in E8, when clicked on that it should copy yje
value of E7 and paste in A1



"Joel" wrote:

What type of object do you have?

You need to go into design mode to assign a macro to an object

from worksheet menu

View - Tool Bars - Control toolbox, then click on triangle ICON enter design
mode.

Then either (depends on object)
1) Right click object and select Assign Macro. Then press New
2) Double click on Object which will automatically create the macro.

Next, enter the copy line (2nd line) from code below into the macro that was
created by excel.


Sub Picture2_Click()
Range("A1").Value = Range("D7").Value
End Sub


Finally, exit design mode by clicking on Triangular Icon in the toolbar.

"Kashyap" wrote:

Hi,

Say I have objects placed in Col c, d, e, f, g, h, i, j in row 8 and I need
to assign macro for each object such that

when I click on object which is in d8, then it should copy the value of d7
and paste in may be a1

when I click on object which is in e8, then it should copy the value of e7
and paste in may be a1 again.. and so on..

can anyone help me with this pls..

Thanks..

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
how do i prepare a macro to insert drawing object on specific cell Harshad[_2_] Excel Discussion (Misc queries) 2 November 25th 08 08:06 AM
Macro to insert an object in a specific cell 2007` mpsears62 Excel Discussion (Misc queries) 2 July 7th 08 07:04 PM
Snap an object to a cell border via macro Brettjg Excel Discussion (Misc queries) 9 May 1st 07 02:10 PM
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error [email protected] Excel Discussion (Misc queries) 4 September 25th 06 01:35 PM
Dynamically adding an in-cell drop-down list (i.e. Validation Object) to a cell? debartsa Excel Programming 5 March 5th 04 08:45 AM


All times are GMT +1. The time now is 11:24 PM.

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

About Us

"It's about Microsoft Excel"