name of range from macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Hi Miroslav,

Try:

Sub Tester()
Dim rw As Long

rw = 20

ActiveWorkbook.Names.Add Name:="myName", _
RefersToR1C1:="='mySheet'!R2C1:R" & rw & "C8"
End Sub
 
Hi Norman,
thank you very much an advise. It works.
Regards,
Miroslav

„Norman Jones" napísal (napísala):
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top