Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a loop that moves through sheets as "i" changes in a loop. I have
sheets named 1,2,3,4,5 etc. For some reason when I run this I get an error saying the subscript is out of range for the last line below: Dim i As Long Dim startWS As Worksheet Dim startRange As Range Set startWS = ActiveSheet Set startRange = Selection For i = 3 To 12 startRange.AutoFilter Field:=3, Criteria1:=CStr(i) Selection.AutoFilter Field:=7, Criteria1:="Monday" Cells.Select Selection.SpecialCells(xlCellTypeVisible).Select Selection.Copy Sheets("i").Select Any suggestions? thank you! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You have i in quotes, which makes it a string - try it as
sheets(i).select |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank You!
" wrote: You have i in quotes, which makes it a string - try it as sheets(i).select |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Moving Data between sheets in the same workbook and moving data between Workbooks. | Excel Worksheet Functions | |||
Loop in sheets | Excel Programming | |||
Loop through sheets | Excel Programming | |||
Moving through sheets | Excel Programming | |||
Loop across Sheets and number of sheets | Excel Programming |