Rafael Alvares Tubero
New Member
- Joined
- Mar 18, 2011
- Messages
- 45
Hello everybody,
I'm trying to give a name to a range, but it doesn't work. Could you guys help me? See below how I wrote it:
Range("A1").Select
ult_lin = Cells(Rows.Count, 1).End(xlDown).Row
ult_lin1 = Cells(Rows.Count, 1).End(xlDown).Row
ult_col1 = Cells(ult_lin, Columns.Count).End(xlToRight).Column
Range(Cells(3, 1), Cells(ult_lin1, ult_col1)).Select
ActiveWorkbook.Names.Add Name:="bReuters", RefersToR1C1:="=" & Range("aMarkit") & "!R" & ult_lin & _
"C1:R" & ult_lin1 & "C" & ult_col1 & ""
It shows this error: "Run-time error '1004': Method 'Range"of object '_Global' failed"
Thanks,
I'm trying to give a name to a range, but it doesn't work. Could you guys help me? See below how I wrote it:
Range("A1").Select
ult_lin = Cells(Rows.Count, 1).End(xlDown).Row
ult_lin1 = Cells(Rows.Count, 1).End(xlDown).Row
ult_col1 = Cells(ult_lin, Columns.Count).End(xlToRight).Column
Range(Cells(3, 1), Cells(ult_lin1, ult_col1)).Select
ActiveWorkbook.Names.Add Name:="bReuters", RefersToR1C1:="=" & Range("aMarkit") & "!R" & ult_lin & _
"C1:R" & ult_lin1 & "C" & ult_col1 & ""
It shows this error: "Run-time error '1004': Method 'Range"of object '_Global' failed"
Thanks,