Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you, gmorris, for the prompt reply and help. I greatly appreciate it
as I've spent a great deal of time trying to make this work. Thanks again, Pam "gmorris" wrote in message ... Well, I tried this code and didn't have much success with it either. I have all of the options on to make sure that variables are declared and such (VERY important), so I got numerous errors until I changed it to this: Sub findblanks() Dim Segment As Range, NewSht As Excel.Worksheet Dim NewRowCount As Integer, sht As Excel.Worksheet Dim SearchRange As Range Dim RowCount As Integer, ColCount As Integer Set Segment = Range("A1:D15") Set NewSht = Sheets.Add(after:=Sheets(Sheets.Count)) NewSht.Name = "Blanks" NewRowCount = 1 For Each sht In Sheets If sht.Name < "Blanks" Then Set SearchRange = Segment For RowCount = 1 To SearchRange.Rows.Count For ColCount = 1 To SearchRange.Columns.Count If SearchRange.Cells(RowCount, ColCount) = "" Then SearchRange.Rows(RowCount).Copy Destination:=NewSht.Rows(NewRowCount) NewRowCount = NewRowCount + 1 Exit For End If Next ColCount Next RowCount End If Next sht End Sub Not sure why people don't want to Dim their vars, but even that didn't work like you are wanting (at least I don't think so). It filled out the entire worksheet with the same sets of data for some reason. I'll have to look into it some more to figure out why... -- gmorris ------------------------------------------------------------------------ gmorris's Profile: http://www.thecodecage.com/forumz/member.php?userid=245 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=91772 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditionally copy from multiple sheets to one sheet | Excel Programming | |||
Copy data from multiple sheets into new sheet | Excel Worksheet Functions | |||
How do I copy setting from one sheet to multiple sheets in Excel? | Excel Discussion (Misc queries) | |||
Copy paste WkBk/sheet 1 to multiple wkbks/sheets | Excel Programming | |||
copy data in one sheet to multiple sheets in same workbook | Excel Worksheet Functions |