Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
JonathanK1 wrote:
Is there a way for it to pull the headers as well? There's quite a bit of data in the rows so it's tough to tell what's what in the new workbook without them. Sub copier() Dim TheAnswer As String Dim working As Worksheet, dumping As Workbook Set working = ActiveSheet TheAnswer = LCase$(InputBox("State?")) Set dumping = Workbooks.Add '***YOU MUST ADJUST THIS LINE*** For x = 1 To (number of header rows) working.Rows(x).EntireRow.Copy dumping.Activate ActiveSheet.Paste ActiveCell.Offset(1).Select Next For x = 1 To working.Cells.SpecialCells(xlCellTypeLastCell).Row If LCase$(working.Cells(x, 8).Value) = TheAnswer Then working.Rows(x).EntireRow.Copy dumping.Activate ActiveSheet.Paste ActiveCell.Offset(1).Select End If Next Application.CutCopyMode = False End Sub -- - I expect you know best, as usual. - I do -- when I know anything. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy Worksheets to New Book | Excel Programming | |||
copy worksheets to new book without linking to original book | Excel Discussion (Misc queries) | |||
VB Scrpit to input search results in Excel work book | Excel Programming | |||
Copy Worksheets from one book to another? | Excel Programming | |||
copy from one book to another | Excel Programming |