Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
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
macro range tlwhite Excel Discussion (Misc queries) 1 March 15th 10 03:44 PM
Macro deletes row in range, macro then skips the row moved up steven.holloway Excel Discussion (Misc queries) 8 June 11th 08 11:40 AM
Macro won't execute when "For Each 'range' in 'range'" is added Bill Dika Excel Programming 1 July 12th 04 07:33 PM
Set Range in one macro to range in another Tim Excel Programming 0 February 25th 04 12:16 PM
Macro to input formula in range based on another range Peter Atherton Excel Programming 0 October 9th 03 12:47 AM


All times are GMT +1. The time now is 07:13 AM.

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"