Creating a Macro that compensates for new info

Taxacctintern

New Member
Joined
Jul 3, 2009
Messages
6
I have a file that weekly I download from an internal program and copy to an excel spreadsheet. The file tracks sales/items for sale. I then have to sort the items by 4 different criteria with an inserted space between the different sections. The first two sorts are done using these formulas (VLOOKUP(A3, 'Special price'!$A$2:$B$21, 2, FALSE)
VLOOKUP(A24, 'Special price'!$A$22:$B$91, 2, FALSE). The remaining two sorts are done using two of the columns. So what is included in the first sort of is anything from the current 19662 items that matches the first formula which I paste to all items then sort sm to large, then I add a spacer line, then run second for remaining items, sort sm to lg, then sort by the two columns. So, my question is, I can run the macro to perform how I need it to for the given weeks info, but say I download next week and there are 19672 items instead, the macro doesn't adjust to include those items. I have manually tried to add those lines in VBA but it usually ends up in error. Any ideas or do I just have to run sm macors to accomplish what I need to?
 
Thanks for the help. I have to work on a few things real quick, and will have to get back to this later. I'll let you know how its going. Thanks for your help.
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,215,737
Messages
6,126,558
Members
449,318
Latest member
Son Raphon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top