I am having a little trouble referring to named ranges.
I had what I feel is a simple problem. I have a sheet("Sheet1") which has a lot of data to make things simpler later column ranges were defined. Two of these are number(represents a class number) and name(its a name).
For each class number I am attempting to add a sheet for that class number and then copy their names to that sheet. So I am trying to do it like this but not any success. I can't seem to refer to i in number.
I had what I feel is a simple problem. I have a sheet("Sheet1") which has a lot of data to make things simpler later column ranges were defined. Two of these are number(represents a class number) and name(its a name).
For each class number I am attempting to add a sheet for that class number and then copy their names to that sheet. So I am trying to do it like this but not any success. I can't seem to refer to i in number.
Code:
i = o
For each i in Worksheet("Sheet1"); 'number'
' find number match add sheet and increment i 1 until no matching i
If i in number =+1 then
Sheets.Add
Sheets.Name = "i"
Next i
End If
If i = Number Then Names Copy
Sheets("i").Select
ActiveSheet.Paste
Next i
End Sub