Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro that selects two cells say c3 and c5 at different times in the
same run. I need to store the cell addresses of C3 and C5 so that the macro can use them to create a print range by offsetting from the two addresses of c3 and c5. The problem is how can I store the addresses of the two cells when the macro selects them. If value (say in cell c3) = 3 and the macro selects this cell then I want the address of the selected cell, here being C3, to be stored for use later . would appreciate the code that has to be included to do this |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If C3 and C5 are fixed, you already know their addresses so why would you
want to save them. Nevertheless, here is the code Sub Macro1 'Declare two string variables to store the addresses Dim sAddress1$,sAddress2$ 'When C3 has been selected sAddress1 = Selection.Address 'When C3 has been selected sAddress2 = Selection.Address End Sub Hope this is what you were looking for. Alok Joshi "SMH" wrote: I have a macro that selects two cells say c3 and c5 at different times in the same run. I need to store the cell addresses of C3 and C5 so that the macro can use them to create a print range by offsetting from the two addresses of c3 and c5. The problem is how can I store the addresses of the two cells when the macro selects them. If value (say in cell c3) = 3 and the macro selects this cell then I want the address of the selected cell, here being C3, to be stored for use later . would appreciate the code that has to be included to do this |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I store through a cell that contains a cell address in it? | Excel Discussion (Misc queries) | |||
store address in a cell and use it in formula | Excel Discussion (Misc queries) | |||
Data Validation: Store cell address instead of value in the cell? | Excel Discussion (Misc queries) | |||
Help Pls re macro cell address | Excel Discussion (Misc queries) | |||
store cell contents and cell address for comparsion & suming | Excel Programming |