'Delete rows between certain values [closed]
I'd like make a task for my work way more simple, but in pretty lost since I'm just starting to learn VBA.
What I wanna make easier is a process of removing certaing data from an excel sheet.
Please, see the image, I think it's easier to understand.
I'd like to ask for an input of a market in column P. Let's say the user enters "Portugal". Then it would look for the rows that have that value in column P and delete the ones that doesn't contain information for Portugal (e.g. it would delete rows from 6 to 9 and 21 to 25, but rows 2-5 and 10-20 should not be deleted).
Any good ideas? I think it should be simple somehow but I can't think of any solution.
Thanks
Solution 1:[1]
Let me teach you some Excel magic:
- Select the entire column "P".
- Press Ctrl+G , choose "Special" and then "Blanks".
- Click in the address bar and type
=P2. - Press Ctrl+ENTER (don't forget the Ctrl button!)
This should fill in the "P" column as you desire and from then on, you can use the basic autofilter.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dominique |

