VBA to delete blank cells and duplicates in different work sheet

Listter

New Member
Joined
Feb 7, 2014
Messages
2
Hi,

I tried the following code and it worked ok. But I want the results on a different worksheet, ie sheet2, in the same book.
I also want to apply this only on the specific two columns F and G.(I want to leave the other columns as they are)

regards,
Listter


Sub RemoveNoise() Dim lngLastRow As Long Rows(1).Insert lngLastRow = Range("A" & Rows.Count).End(xlUp).Row With Range("B1:B" & lngLastRow) .Formula = "=COUNTIF($A$1:A1,A1)" .AutoFilter 1, "<>1" End With With Rows("1:" & lngLastRow) .SpecialCells(xlCellTypeVisible).Clear .Rows("1:" & lngLastRow).Sort Range("A1"), xlAscending End With Columns("B").Clear End Sub</pre>
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Thanks.
Sorry, I forgot to add one more thing. I want to begin from the row 10, I think using xlshiftdown code... like attached.

View image: 161883
iller03on
 
Upvote 0

Forum statistics

Threads
1,223,250
Messages
6,171,036
Members
452,374
Latest member
keccles

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