RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 801
- Office Version
- 365
- Platform
- Windows
I have a spreadsheet that a group of people in the business use, they're not very computer savvy or... dare I say... common-sense savvy either so I have to do a fair amount of literal foolproofing.
On this sheet they have times, dates, flight codes etc per customer per line. I have a macro that runs when the spreadsheet opens that reformats things to the "proper" sense of the word, like capitalising some columns, aligning others, etc.
As part of my code is the following:
This is ensuring that all dates are present as "11/02/2019"
There is also formatting code that trims spaces, removes spaces, etc.
The way the sheet works is the staff select a product and a date, which are in a user form. The data is generated by going through the sheet and assigning each product + date together.
When the staff select product A, they then select a date and press a button and it displays the information on a new tab.
However, when the staff select product B and select a date, nothing comes up.
BUT.
If I go into the cell which holds the dates and just press enter, this particular row will show up. Therefore, if there are 8 dates for a product and I go into each date and press enter, all 8 dates will show up on the new tab.
Clearly there is something wrong with the date but I am not sure what. It is formatted in the same way. It is in the same cell format.
If I then reapply the formatting macro, I have to go into each of the cells and press enter again, but only on certain products - It's truly baffling!
On this sheet they have times, dates, flight codes etc per customer per line. I have a macro that runs when the spreadsheet opens that reformats things to the "proper" sense of the word, like capitalising some columns, aligning others, etc.
As part of my code is the following:
Code:
' DATES
Range("F:G").NumberFormat = "dd/mm/yyyy"
Range("M:M").NumberFormat = "dd/mm/yyyy"
Range("R:R").NumberFormat = "dd/mm/yyyy"
This is ensuring that all dates are present as "11/02/2019"
There is also formatting code that trims spaces, removes spaces, etc.
The way the sheet works is the staff select a product and a date, which are in a user form. The data is generated by going through the sheet and assigning each product + date together.
When the staff select product A, they then select a date and press a button and it displays the information on a new tab.
However, when the staff select product B and select a date, nothing comes up.
BUT.
If I go into the cell which holds the dates and just press enter, this particular row will show up. Therefore, if there are 8 dates for a product and I go into each date and press enter, all 8 dates will show up on the new tab.
Clearly there is something wrong with the date but I am not sure what. It is formatted in the same way. It is in the same cell format.
If I then reapply the formatting macro, I have to go into each of the cells and press enter again, but only on certain products - It's truly baffling!
Last edited: