B
Brad
Does anyone know how to fix the code below? It's not setting the ranges
correctly
Sub Addnames1()
Dim irow As Integer
irow = 0
With shtTerm.Range("bx25")
Do
ActiveWorkbook.Names.Add _
Name:=.Offset(irow, 0), _
RefersTo:= _
.Offset(irow, 1).Value
irow = irow + 1
Loop Until .Offset(irow, 0) = ""
End With
End Sub
Starting in bx25
TR30MNE V23:V61
TR30MPE W23:W61
TR30MSE X23:X61
TR30FNE Y23:Y61
TR30FPE Z23:Z61
TR30FSE AA23:AA61
TR30UNE AB23:AB61
TR30UPE AC23:AC61
TR30USE AD23:AD61
TR30MNE AE23:AE61
TR30MPE AF23:AF61
TR30MSE AG23:AG61
TR30FNE AH23:AH61
TR30FPE AI23:AI61
TR30FSE AJ23:AJ61
TR30UNE AK23:AK61
TR30UPE AL23:AL61
TR30USE AM23:AM61
correctly
Sub Addnames1()
Dim irow As Integer
irow = 0
With shtTerm.Range("bx25")
Do
ActiveWorkbook.Names.Add _
Name:=.Offset(irow, 0), _
RefersTo:= _
.Offset(irow, 1).Value
irow = irow + 1
Loop Until .Offset(irow, 0) = ""
End With
End Sub
Starting in bx25
TR30MNE V23:V61
TR30MPE W23:W61
TR30MSE X23:X61
TR30FNE Y23:Y61
TR30FPE Z23:Z61
TR30FSE AA23:AA61
TR30UNE AB23:AB61
TR30UPE AC23:AC61
TR30USE AD23:AD61
TR30MNE AE23:AE61
TR30MPE AF23:AF61
TR30MSE AG23:AG61
TR30FNE AH23:AH61
TR30FPE AI23:AI61
TR30FSE AJ23:AJ61
TR30UNE AK23:AK61
TR30UPE AL23:AL61
TR30USE AM23:AM61