Hello,
I am trying to select multiple sheets using the following Code:
"Sub CopySheets()
Dim x As Integer
Dim y As Integer
Dim ws As Worksheet
x = ActiveWorkbook.Sheets.Count - 2
y = ActiveSheet.Index
n = Worksheets("Test").Cells(4, 2)
m = Cells(7, 18)
Namex = ActiveSheet.Name
Do Until x = y
If m = n Then
Sheets(Namex).Select False
End If
ActiveSheet.Next.Select
Namex = ActiveSheet.Name
m = Cells(7, 18)
Loop
End Sub"
My problem is...the code will not select more than one sheet at a time. How do I get it to select the first sheet that meets the requirement and then select the other sheets that meet the requirement without unselecting the first sheet?
Thanks,
Lee
I am trying to select multiple sheets using the following Code:
"Sub CopySheets()
Dim x As Integer
Dim y As Integer
Dim ws As Worksheet
x = ActiveWorkbook.Sheets.Count - 2
y = ActiveSheet.Index
n = Worksheets("Test").Cells(4, 2)
m = Cells(7, 18)
Namex = ActiveSheet.Name
Do Until x = y
If m = n Then
Sheets(Namex).Select False
End If
ActiveSheet.Next.Select
Namex = ActiveSheet.Name
m = Cells(7, 18)
Loop
End Sub"
My problem is...the code will not select more than one sheet at a time. How do I get it to select the first sheet that meets the requirement and then select the other sheets that meet the requirement without unselecting the first sheet?
Thanks,
Lee