Creating macro to search two values and delete them
Closed
RICARDOALVAREZOROZCO
Posts
1
Registration date
Sunday May 15, 2016
Status
Member
Last seen
May 15, 2016
-
May 15, 2016 at 05:53 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - May 16, 2016 at 07:33 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - May 16, 2016 at 07:33 AM
Related:
- Creating macro to search two values and delete them
- Yahoo search history delete - Guide
- How to delete whatsapp account without login - Guide
- Safe search settings - Guide
- How to search google usa - Guide
- How to delete search history on ps4 - Guide
1 response
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
May 16, 2016 at 07:33 AM
May 16, 2016 at 07:33 AM
Hello Ricardo,
Following is some code that should do the task for you:-
Following is the link to my test work book. Click on the run button to see it work:-
https://www.dropbox.com/s/v065miwqw7m2spy/Ricardo%28Find%20all%20values%20between%202%20values%2C%20AutoFilter%29.xlsm?dl=0
I have just used numbers as the values in the test work book.
The criteria values in F1 and F2 are also cleared ready for new values.
I hope that this helps.
Cheerio,
vcoolio.
Following is some code that should do the task for you:-
Option Explicit Sub FindStuff() Application.DisplayAlerts = False Dim val1 As Long: val1 = [F1] Dim val2 As Long: val2 = [F2] Dim lr As Long lr = Range("I" & Rows.Count).End(xlUp).Row Range("I1:I" & lr).AutoFilter 1, ">=" & val1, xlAnd, "<=" & val2 Range("I2:I" & lr).Delete [I1].AutoFilter Range("F1:F2").ClearContents Application.DisplayAlerts = True End Sub
Following is the link to my test work book. Click on the run button to see it work:-
https://www.dropbox.com/s/v065miwqw7m2spy/Ricardo%28Find%20all%20values%20between%202%20values%2C%20AutoFilter%29.xlsm?dl=0
I have just used numbers as the values in the test work book.
The criteria values in F1 and F2 are also cleared ready for new values.
I hope that this helps.
Cheerio,
vcoolio.