Trying to Move Row to new tab with specific cell is blank

Microsoft Excel 2003 (full product)
April 6, 2012 at 10:44:23
Specs: Windows XP
I have a large spreadsheet with about 18 columns. I have already created the macro to create a new tab and add headers to the new Tab. I need to figure out the part of the macro where if my column 'F' has no data, then cut and past all those rows to the new tab.

Please help. FYI - I am still in MS Excel 2003.

See More: Trying to Move Row to new tab with specific cell is blank

April 6, 2012 at 18:51:55
This code assumes that both the Source Data and New Tab sheets have data in Column A since it uses Column A to determine the length of data in both sheets.

Obviously you'll need to change the sheet names to match yours...

Sub NoF_Data()
'Determine last row with data in Source Data sheet
 last_src_rw = Sheets("Source Data").Range("A" & Rows.Count).End(xlUp).Row
'Loop through rows in Source Data sheet
 For src_Rw = 1 To last_src_rw
'If Column F is empty, determine next empty row in New Tab sheet
'and then copy entire row to New Tab
  If Sheets("Source Data").Range("F" & src_Rw) = "" Then
   nxt_dst_rw = Sheets("New Tab").Range("A" & Rows.Count).End(xlUp).Row + 1
    Sheets("Source Data").Range("F" & src_Rw).EntireRow.Copy _
     Destination:=Sheets("New Tab").Range("A" & nxt_dst_rw)
  End If
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •
Related Solutions

Ask Question