Copy adjacent cell value next to blank onto new sheet

diab0lik

New Member
Joined
Jan 12, 2015
Messages
4
Hi there,could some one please help me?i need to find all the blanks in one column and copy the adjacent cell onto a new sheet (sheet1)my table looks like this
[TABLE="width: 500"]
<tbody>[TR]
[TD]tracking no
[/TD]
[TD]filled date
[/TD]
[/TR]
[TR]
[TD]1234
[/TD]
[TD]1/1/20
[/TD]
[/TR]
[TR]
[TD]1235
[/TD]
[TD]1/2/20
[/TD]
[/TR]
[TR]
[TD]1236
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1237
[/TD]
[TD]2/2/20
[/TD]
[/TR]
[TR]
[TD]1238
[/TD]
[TD]2/3/20
[/TD]
[/TR]
[TR]
[TD]1239
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

on separate sheet (sheet2) i would like to get a list of all the unfilled tracking numbers outputted like:
[TABLE="width: 500"]
<tbody>[TR]
[TD]tracking
[/TD]
[/TR]
[TR]
[TD]1236
[/TD]
[/TR]
[TR]
[TD]1239
[/TD]
[/TR]
</tbody>[/TABLE]


thanks for any help you can provide
 
Last edited:

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
We always need specific details.
You said:
i need to find all the blanks in one column and copy the adjacent cell onto a new sheet (sheet1)my table looks like this

You did not say what column and what is the adjacent column
And you said:
Copy to a new sheet but did not say where. WE need all sheet names
We need to know what columns

And does the script need to create the new sheet?
If so what name should we give to this new sheet.
 
Upvote 0
Sorry i wasnt clear i have 2 sheets they are just labelled sheet1 and sheet2in sheet1 the "tracking no." column is A and the "filled order" column is B. i want to be able to generate a list on sheet2 that has all the cells in column A (tracking no.) where column B (filled order) is blankno need to create new sheet it is already there. can you see the table?thanks. please let me know if you need more info
We always need specific details.You said:
i need to find all the blanks in one column and copy the adjacent cell onto a new sheet (sheet1) my table looks like thisYou did not say what column and what is the adjacent columnAnd you said:Copy to a new sheet but did not say where. WE need all sheet namesWe need to know what columnsAnd does the script need to create the new sheet?If so what name should we give to this new sheet.
 
Upvote 0
Try this:
Run this script from sheet1

Code:
Sub My_Filter()
'Modified  7/25/2019  8:41:47 AM  EDT
Application.ScreenUpdating = False
Dim lastrow As Long
Dim c As Long
Dim s As Variant
c = 2 ' Column Number Modify this to your need
s = "" 'Search Value Modify to your need
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
With ActiveSheet.Cells(1, c).Resize(lastrow)
    .AutoFilter 1, s
    counter = .Columns(c).SpecialCells(xlCellTypeVisible).Count
    If counter > 1 Then
        .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets(2).Rows(1)
    Else
        MsgBox "No values found"
    End If
    .AutoFilter
End With
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Here is another macro that you can consider...
Code:
[table="width: 500"]
[tr]
	[td]Sub UnfilledTrackingNumbers()
  With Sheets("Sheet1")
    On Error Resume Next
    Intersect(.Range("B2:B" & .Cells(Rows.Count, "A").End(xlUp).Row).SpecialCells(xlBlanks).EntireRow, .Columns("A")).Copy Sheets("Sheet2").Range("A1")
    If Err.Number Then MsgBox "There are no unfilled tracking numbers.", vbExclamation
    On Error GoTo 0
  End With
End Sub
[/td]
[/tr]
[/table]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,970
Messages
6,175,703
Members
452,667
Latest member
vanessavalentino83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top