-
[vba]
For Each NameCell In NameRange.Cells
Set WS = ThisWorkbook.Worksheets(NameCell.Value)
[/vba]
There are 65K plus NameCells. Only one has a value. The second time thru, you're trying to Set Ws to Null.
Try this
[vba]
yaddah, yaddah
If NameRange.Cells.Count > 65000 Then Set NameRange = Range("A4")
For Each NameCell In NameRange.Cells
Set WS = ThisWorkbook.Worksheets(NameCell.Value)
yaddah, yaddah
[/vba]
Last edited by SamT; 03-25-2010 at 03:54 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules