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 does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

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