This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi, All!
Firstly - I am super stoked to see that this subreddit exists! I am new to VBA and it feels like I have to get in my time machine every time I get up visual basic. I have written a few successful scripts so far, including:
1) locate values in a column where I want all cells to be null, and once said cells have been located, delete the entire row(s) around them
2) locate nulls in a column where I need strings, and replaced said nulls with string
3) locate duplicates and remove them
now, what I am wanting to do, is a little like three but more complex. I want to search for duplicates in a column, and rather than deleting all duplicated and leaving one, I would like to write a script(s) that locates duplicates, and keeps 3, 5, 10 or 20 of the duplicate. I could have duplicates ranging from zero to 100. So I would like a dynamic option. So really, there are two needs I have here:
i) how can I remove duplicates but leave 'x' amount, rather than just 1?
ii) To make this 'dynamic', if i) is possible, I could just copy and paste the sub, substituting in various numbers. Is there instead, a user-friendly interface that I could get to pop up when the macro is ran, prompting the user to enter a number of their choosing?
i) is priority here
If possible, I can *probably* figure out ii). That would just be a something extra nice.
Any help at all, or directions to stack overflow or other websites would be very much appreciated! :)
Subreddit
Post Details
- Posted
- 5 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/vba/comment...