I am trying to have 2 loops within the same procedure. The procedure is attempting to loop through a list of area servers (firstly) and the a list of local servers after that. The problem I have is discerning between them. I usually use:
However I cannot work out how to have 2 separate loops in the same procedure. I have attached the start of my code below. I get an error message:
Run Time Error 1004
"Method 'Range' of object '_Global' failed
All assistance appreciated.
Thnx
Stuart
<font face=Courier New><SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> c <SPAN style="color:#00007F">In</SPAN> Range(SvrName)
</FONT>
However I cannot work out how to have 2 separate loops in the same procedure. I have attached the start of my code below. I get an error message:
Run Time Error 1004
"Method 'Range' of object '_Global' failed
All assistance appreciated.
Thnx
Stuart
<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> GetAllData()
<SPAN style="color:#00007F">Dim</SPAN> BrName <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN>
<SPAN style="color:#00007F">Dim</SPAN> ThisMonth <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN>
<SPAN style="color:#00007F">Dim</SPAN> SvrName <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN>
Sheets("DataEntry").Select
Load DateSelector
DateSelector.Show
Application.ScreenUpdating = <SPAN style="color:#00007F">False</SPAN>
Application.DisplayAlerts = <SPAN style="color:#00007F">False</SPAN>
Application.EnableEvents = <SPAN style="color:#00007F">False</SPAN>
<SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> Cell <SPAN style="color:#00007F">In</SPAN> Range(ListSvrs)
SvrName = Cell.Value
<SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> c <SPAN style="color:#00007F">In</SPAN> Range(SvrName)</FONT>