Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey guys,
I’m new to this VBA stuff and could use some help. I'm trying to cop several worksheets into a new workbook. I'm using a loop to check couple of Boolean fields to see if the sheet should be copied, if it' true I would copy into a brand new workbook. However, I get stuck o the second approach of the loop… Here's my code...Any ideas what I'm doing wrong? Any Assistance would greatly be appreciated!! Sub Macro_test() Dim wbk1 As Workbook Dim wbk2 As Workbook Dim IncludeSheet As String Dim DataSheet As String Dim Number As Integer Set wbk1 = ActiveWorkbook Set wbk2 = Workbooks.Add wbk1.Activate Number = 1 For CounterComp = 6 To 15 IncludeSheet = wbk1.Worksheets("Landscap Labels").Cells(CounterComp, 31) DataSheet = wbk1.Worksheets("Landscape Labels").Cells(CounterComp 7) If IncludeSheet = True Then Sheets(DataSheet).COPY After:=wbk2.Sheets(Number) Number = Number + 1 Else Number = Number + 1 End If Next CounterComp End Su -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying multiple cells out of multiple worksheets at same time. | Excel Discussion (Misc queries) | |||
copying multiple worksheets to a new workbook | Excel Discussion (Misc queries) | |||
Copying worksheets to a new workbook | Excel Discussion (Misc queries) | |||
Copying Worksheets from 1 Workbook to another | Excel Programming | |||
Copying worksheets to a new workbook | Excel Programming |