Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of range from macro
I have command:
ActiveWorkbook.Names.Add Name:="myName", RefersToR1C1:="='mySheet'!R2C1:R20C8" but the row 20 is changeable. How could I modify the command? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of range from macro
Hi Miroslav,
Try: Sub Tester() Dim rw As Long rw = 20 ActiveWorkbook.Names.Add Name:="myName", _ RefersToR1C1:="='mySheet'!R2C1:R" & rw & "C8" End Sub --- Regards, Norman "Miroslav" wrote in message ... I have command: ActiveWorkbook.Names.Add Name:="myName", RefersToR1C1:="='mySheet'!R2C1:R20C8" but the row 20 is changeable. How could I modify the command? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of range from macro
Hi Norman,
thank you very much an advise. It works. Regards, Miroslav €žNorman Jones" napÃ*sal (napÃ*sala): Hi Miroslav, Try: Sub Tester() Dim rw As Long rw = 20 ActiveWorkbook.Names.Add Name:="myName", _ RefersToR1C1:="='mySheet'!R2C1:R" & rw & "C8" End Sub --- Regards, Norman "Miroslav" wrote in message ... I have command: ActiveWorkbook.Names.Add Name:="myName", RefersToR1C1:="='mySheet'!R2C1:R20C8" but the row 20 is changeable. How could I modify the command? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro range | Excel Discussion (Misc queries) | |||
Macro deletes row in range, macro then skips the row moved up | Excel Discussion (Misc queries) | |||
Macro won't execute when "For Each 'range' in 'range'" is added | Excel Programming | |||
Set Range in one macro to range in another | Excel Programming | |||
Macro to input formula in range based on another range | Excel Programming |