Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i prepare a macro to insert drawing object on specific cell | Excel Discussion (Misc queries) | |||
Macro to insert an object in a specific cell 2007` | Excel Discussion (Misc queries) | |||
Snap an object to a cell border via macro | Excel Discussion (Misc queries) | |||
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error | Excel Discussion (Misc queries) | |||
Dynamically adding an in-cell drop-down list (i.e. Validation Object) to a cell? | Excel Programming |