Hi,
I tried posting this question on the Microsoft forum and I'm not getting any responses, so I hope you will excuse me for cross-posting here.
I'm trying to add a step to a macro that I use to clean up data before importing it into a database. I want the macro to select all the data in the open worksheet, then sort it by the first column (header row name is ID) because the data I receive is in reverse chronological order, from newest to oldest.
My problem is that the amount of data varies from day to day, so I cannot assign a fixed range. When I try to use the CurrentRegion, I get an error that the "Argument is not Optional" (which I gather means that you need an actual concrete value, rather than a variable, as a parameter.) I tried assigning a name to the CurrentRegion range and also counting the resulting range. No luck either way, though that might have been because I didn't get the syntax correct.
I could just assign a huge random range that would cover the largest amount of data possible, but I know there must be a more straightforward way around this situation and I would like to understand the syntax better. I usually fumble my way through by recording operations and then trying to dissect the VBA, but that has it's limitations. (:
Here is my code in it's present state:
Many thanks in advance for any suggestions!Please Login or Register to view this content.
Pax,
SME
Bookmarks