pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
hi, myname range created is showing range as '"Sheet2!$A$1" instead of Sheet2!$A$1 when i hit ctrl + f3 and checked it...
I need to name a range for all the words in col a if not blank.
I got this far but names are created with error.
Please advice on how to correct this.
My current code as below.
I need to name a range for all the words in col a if not blank.
I got this far but names are created with error.
Please advice on how to correct this.
My current code as below.
Code:
Sub try()
Dim i As Long
Dim sh As Worksheet
For i = 1 To 200
If Range("A" & i).Value <> "" Then
Range("A" & i).Select
ActiveWorkbook.Names.Add Name:=ActiveCell.Value, RefersToR1C1:=ActiveSheet.Name & "!" & ActiveCell.Address
ActiveWorkbook.Names(ActiveCell.Value).Comment = ""
End If
Next i
End Sub