Sub Name_ranges_complete()
'Starts at the currently selected cell. USER IS TO MAKE SURE TOP CELL OF THE RANGE IS SELECTED BEFORE RUNNING IT
'Varname stores the name of the range
x = ActiveCell.Row
Dim column As Integer
Dim VarName As Variant
column = 2
'The items to be named as a range are in column B
ActiveCell.Offset(0, 1).Select
'The name of the range is in the cell next to the first item of the range in column C
Application.CutCopyMode = False
VarName = Selection.Copy
ActiveCell.Offset(0, -1).Select
'After the name of the range has been selected and copied it goes back to the first item of the range
'The range will be comprised of 108 items on the current column B and so they get selected
myrow = ActiveCell.Row
mycol = ActiveCell.column
numrows = 107
lastrow = myrow + numrows
Range(Cells(myrow, mycol), Cells(lastrow, mycol)).Select
Application.CutCopyMode = False
'on the following line I get Run-time error '1004: The name that you entered is not valid...
'however the name in question is simply flashingA which does not seem to have any invalid characters
'spaces and it hasnot been used to name any other objects
ActiveWorkbook.Names.Add name:=CStr(VarName), RefersTo:=Selection
'If I tried the following I would get the same Run-time error '1004
'Selection.name = VarName
End Sub