G
Guest
I have a subroutine that has been working fine until I added 3 worksheets
from another workbook. It seems that when I activate a worksheet then refer
to the ActiveSheet that I am getting a different worksheet. Here is a
portion of the code.
Worksheets("RatesByLevel").Activate
b_end = False
'*** First row contains query name and 2nd row contains Column headings so
start at the 3nd row on the sheet
'*** by initalizing the counter to 2.
i_rownum = 2
'*** Using Base 0 array so set the indexes to their initial setting
i_indxGeo = 0
i_indxLoc = 0
'*** Loop through the entire worksheet until we hit a blank geo value **
Do Until b_end
i_rownum = i_rownum + 1
'*** End the loop when we come to a blank row ***
If ActiveSheet.Range("C" & i_rownum) = "" Then
b_end = True
Else
The worksheet activate is activating Sheet 12 but the ActiveSheet statement
is accessing Sheet 20.
from another workbook. It seems that when I activate a worksheet then refer
to the ActiveSheet that I am getting a different worksheet. Here is a
portion of the code.
Worksheets("RatesByLevel").Activate
b_end = False
'*** First row contains query name and 2nd row contains Column headings so
start at the 3nd row on the sheet
'*** by initalizing the counter to 2.
i_rownum = 2
'*** Using Base 0 array so set the indexes to their initial setting
i_indxGeo = 0
i_indxLoc = 0
'*** Loop through the entire worksheet until we hit a blank geo value **
Do Until b_end
i_rownum = i_rownum + 1
'*** End the loop when we come to a blank row ***
If ActiveSheet.Range("C" & i_rownum) = "" Then
b_end = True
Else
The worksheet activate is activating Sheet 12 but the ActiveSheet statement
is accessing Sheet 20.