ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   insert excel vb script (https://www.excelbanter.com/excel-programming/279954-insert-excel-vbulletin-script.html)

bt707[_6_]

insert excel vb script
 
I have a scipt like this but not sure how to insert it into excel to use
it, can someone tell me how to put it into excel to be able to use it.

Sub RemoveDupes()

'Add extra Column, "A" becomes "B"
Columns(1).EntireColumn.Insert

'Filter out duplicates and copy unique list to "A"
Range("B1", Range("B65536").End(xlUp)).AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=Range("A1"), Unique:=True

'Add extra Column, "B" becomes "A"
Columns(2).EntireColumn.Delete

End Sub

Thanks for any help



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


J.E. McGimpsey

insert excel vb script
 
Take a look at David McRitchie's Getting Started page:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In article ,
bt707 wrote:

I have a scipt like this but not sure how to insert it into excel to use
it, can someone tell me how to put it into excel to be able to use it.

Sub RemoveDupes()

'Add extra Column, "A" becomes "B"
Columns(1).EntireColumn.Insert

'Filter out duplicates and copy unique list to "A"
Range("B1", Range("B65536").End(xlUp)).AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=Range("A1"), Unique:=True

'Add extra Column, "B" becomes "A"
Columns(2).EntireColumn.Delete

End Sub

Thanks for any help



All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com