Macro Recording

  • Thread starter Thread starter Paul W Smith
  • Start date Start date
P

Paul W Smith

Can anyone explain why when I record a macro which names a range, the macro
records

ActiveWorkbook.Names.Add Name:="New NamedRange", RefersToR1C1:= _
"='Cricket Shirts'!R1C1:R26C5"

I am not aware of any setting that tells it to record in RowColumn notation,
I certainly do not have that option ticked in Options | General.

Can anyone explain why the address of the range is not in normal alpha
numeric notations.

PWS
 
Paul

Its just the way Excel works. R1C1 is the active cell and
Excel refers to it in RC notation. Heres one I recorded

Sub Macro1()
' Macro1 Macro
' Macro recorded 01/05/2004 by Peter Atherton

Range("B16:B20").Select
ActiveWorkbook.Names.Add Name:="Rng", _
RefersToR1C1:="=Sheet4!R16C2:R20C2"
End Sub

Note when the range is selected first the AlphaNumeric
notation is used. Normally you would not record a one off
event like createing a range name but you might want to
refer to it later. The sub below selects the name just
created.

Sub Selct()
[rng].Select
End Sub

Regards
Peter
 

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