Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Msg Box to change Macro criteria?
I found the following code on this website and have been using it for a
while. The code deletes rows that I have identified as duplicate rows. Now, my spreadsheet is getting rather large and I was wondering if there is a way to start a msg box or something that would allow me to enter what rows in my column I want to run the macro on... rather than run the code over the thousands of rows I want to keep already. The code is below. Thanks for the help. Sheets("USA Firms").Select Dim rngToSearch As Range Dim wks As Worksheet Dim rngFound As Range Set wks = ActiveSheet Set rngToSearch = wks.Columns(3) Set rngFound = rngToSearch.Find("-") If rngFound Is Nothing Then MsgBox "No Deletions Found" Else Do rngFound.EntireRow.Delete Set rngFound = rngToSearch.FindNext Loop Until rngFound Is Nothing End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Msg Box to change Macro criteria?
I have fixed my problem Thanks!
"John" wrote: I found the following code on this website and have been using it for a while. The code deletes rows that I have identified as duplicate rows. Now, my spreadsheet is getting rather large and I was wondering if there is a way to start a msg box or something that would allow me to enter what rows in my column I want to run the macro on... rather than run the code over the thousands of rows I want to keep already. The code is below. Thanks for the help. Sheets("USA Firms").Select Dim rngToSearch As Range Dim wks As Worksheet Dim rngFound As Range Set wks = ActiveSheet Set rngToSearch = wks.Columns(3) Set rngFound = rngToSearch.Find("-") If rngFound Is Nothing Then MsgBox "No Deletions Found" Else Do rngFound.EntireRow.Delete Set rngFound = rngToSearch.FindNext Loop Until rngFound Is Nothing End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change criteria in a CF | Excel Discussion (Misc queries) | |||
Change Row Colour if certain criteria is met | Excel Worksheet Functions | |||
change/set pivot table autofilter criteria with macro button | Excel Discussion (Misc queries) | |||
Can I change background colors based on criteria from another cel. | Excel Discussion (Misc queries) | |||
Change Criteria in Code | Excel Programming |