clvestin
11-14-2005, 01:37 PM
So--I,m trying to name the range (row 4 to row(end of data in column)) for each column in the sheet, giving the range name= row3 of each column of the sheet. Between losing myself in the R1C1 stuff, generally the line for
refersto:= :="=liqfn!R4C" & kol :"R" & fndcol2&"C"&kol, though convoluted ,seems like it should work.
I know a lot of you have been here before. Any helps?
Public Sub tst1()
For i = 1 To Worksheets.Count
Set fndcol = Worksheets(i).Range("b3", "s1000") _
.Cells.SpecialCells(xlCellTypeLastCell)
fndcol2 = fndcol.Row 'Address(xlR1C1)
fndcol3 = fndcol.Column
' fndrng=range(
For kol = 3 To fndcol.Column
'Set blu = Range("r4C" & kol) ',"R"&fndcol2.row&"C"&kol)
Worksheets(i).Names.Add _
Name:="rngnm" & kol, _
RefersToR1C1:="=liqfn!R4C" & kol ':R" & fndcol2&"C"&kol
',"R4C"&fndcol2.column
':"R"&fndcol2.row&"c"&kol)
'Cells(2, kol).Text
' "rngnm" & kol
'& kol :R"&fndcol2&"C"&kol
Next kol
Next i
refersto:= :="=liqfn!R4C" & kol :"R" & fndcol2&"C"&kol, though convoluted ,seems like it should work.
I know a lot of you have been here before. Any helps?
Public Sub tst1()
For i = 1 To Worksheets.Count
Set fndcol = Worksheets(i).Range("b3", "s1000") _
.Cells.SpecialCells(xlCellTypeLastCell)
fndcol2 = fndcol.Row 'Address(xlR1C1)
fndcol3 = fndcol.Column
' fndrng=range(
For kol = 3 To fndcol.Column
'Set blu = Range("r4C" & kol) ',"R"&fndcol2.row&"C"&kol)
Worksheets(i).Names.Add _
Name:="rngnm" & kol, _
RefersToR1C1:="=liqfn!R4C" & kol ':R" & fndcol2&"C"&kol
',"R4C"&fndcol2.column
':"R"&fndcol2.row&"c"&kol)
'Cells(2, kol).Text
' "rngnm" & kol
'& kol :R"&fndcol2&"C"&kol
Next kol
Next i