Msg Box to change Macro criteria?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Delete rows macro 3
help with macro 10
macro to delete rows on condition 1
findnext error in loop 2
Looping a loop? 3
Find next problem 1
find multiple values code tweak 5
Help with FindNext error 3

Back
Top