Cyberdude
04-06-2006, 01:13 PM
I ran the macro recorder to see how it would create a macro to define a name for the following formula:
=OFFSET(Main!$AT$2222,0,0,COUNTA(Main!$AT:$AT))
It created the following statement which I don?t understand:
ActiveWorkbook.Names.Add Name:="TestName", RefersToR1C1:= _
?=OFFSET(Main! R2222C[26],0,0,COUNTA(Main!C46))"
where column letter ?AT? is column number 46.
1. Notice on the right end of the OFFSET formula that the R1C1 format is C46 whereas the OFFSET formula that I entered has $AT:$AT. Why the difference??
2. Notice on the left side of the formula I wrote I have $AT$2222 which it translated for R1C1 reasons to be R2222C[26]. Why is column ?AT? written as ?C[26]? here, but written as ?C46? on the right end?? Why 26 instead of 46?? What is the significance of the brackets here??
=OFFSET(Main!$AT$2222,0,0,COUNTA(Main!$AT:$AT))
It created the following statement which I don?t understand:
ActiveWorkbook.Names.Add Name:="TestName", RefersToR1C1:= _
?=OFFSET(Main! R2222C[26],0,0,COUNTA(Main!C46))"
where column letter ?AT? is column number 46.
1. Notice on the right end of the OFFSET formula that the R1C1 format is C46 whereas the OFFSET formula that I entered has $AT:$AT. Why the difference??
2. Notice on the left side of the formula I wrote I have $AT$2222 which it translated for R1C1 reasons to be R2222C[26]. Why is column ?AT? written as ?C[26]? here, but written as ?C46? on the right end?? Why 26 instead of 46?? What is the significance of the brackets here??