A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
I cannot open your link and it need to sign in company id. Could you share your file via private message by clicking the icon below.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
On a daily basis I have create an overview of stock in our cold store. For the default tasks I want to do with that data I have created a macro. I always add the way I want the data to be sorted to the macro. For one reason or another, eventually the sorting disappears from the macro. Can I not use a macro for this purpose? I am not familiar with VBA.
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Dear Sirs, thank you for your suggestion. Requested link https://adm-my.sharepoint.com/:x:/r/personal/marion_de_vries_adm_com/Documents/Macro%20data.xlsm?d=w7272e02c4fa240d083c6c5d7c71c17da&csf=1&web=1&e=mPoD5e to the dummy data with the macro in it.
Dear Sirs, thanks for your reply. Sorting was always the last step in the macro. The issue may be the empty rows in the file. Before I upload my data to the excel file I do not know how many lines there will be. This is why there will be empty rows at the end of the file.
Share a test file with dummy data in it. It will help to check your code.
You can upload to OneDrive, Google Drive or DropBox. Then post a link here.
You can also paste your macro code here.
From your description, you should put your sort step at the last of you code.
Best Reagrds,
Snow Lu
You can use a macro to sort your data, but you need to make sure that you record the sorting steps correctly and save the macro after editing it.
Sometimes the sorting may not work if the data range changes or if there are blank rows or columns in your data.
You can try to fix these issues by using a dynamic named range or deleting the blank rows or columns.
You can also check the macro code and see if the sorting criteria are correct.
One is to make sure that you activate the worksheet that you want to sort before running the macro.
Another is to clear any existing sort fields before applying a new sort.
A third one is to select the entire range of data that you want to sort instead of just the first row.
You can try these solutions and see if they work for you.
I hope this helps.