ianquiksilver
New Member
- Joined
- Nov 2, 2017
- Messages
- 11
Hello all! I'm a basic VBA macro-er and after going through plenty search-results trying to find a solution to my problem I finally opted for posting on a forum. So please don't get too impatient with me when you see how basic my question might be.
Its regarding dates and keeping the formatting.
So if I have a date given as "19/06/2017" and I change it to "20170619" by feeding "YYYYMMDD" into the custom formatting thingy that's fine. Now, I would like the actual value of my cell to be changed to be equal to how it looks like with the new formatting, because if I click on the cell that shows "20170619" in my sheet, the Formula Bar shows the "actual" value of the cell being "19/06/2017" instead of "20170619" (see screenshot below), meaning that if I run any code on it, it will consider the real value of the cell to be 19/06/2017 and so the result of any calculation made on them will come out 'wrong'. None of the Special Pastes I tried seemed to achieve this. For example, if I "Paste Value" the value shown below into the cell next to it, it comes out as "42905" (and I have no idea why)
The main reason for this is to have "19/06/2017" converted to "20170619" and passed as a string so I can remove the last 2 digits with MID(dateValue; 1; 6) and then add "01" at the end to make all my dates into the "first of the month", keeping the YYYYMMDD format.
Thanks for your help and patience!
Best regards,
Kris A.
Its regarding dates and keeping the formatting.
So if I have a date given as "19/06/2017" and I change it to "20170619" by feeding "YYYYMMDD" into the custom formatting thingy that's fine. Now, I would like the actual value of my cell to be changed to be equal to how it looks like with the new formatting, because if I click on the cell that shows "20170619" in my sheet, the Formula Bar shows the "actual" value of the cell being "19/06/2017" instead of "20170619" (see screenshot below), meaning that if I run any code on it, it will consider the real value of the cell to be 19/06/2017 and so the result of any calculation made on them will come out 'wrong'. None of the Special Pastes I tried seemed to achieve this. For example, if I "Paste Value" the value shown below into the cell next to it, it comes out as "42905" (and I have no idea why)
The main reason for this is to have "19/06/2017" converted to "20170619" and passed as a string so I can remove the last 2 digits with MID(dateValue; 1; 6) and then add "01" at the end to make all my dates into the "first of the month", keeping the YYYYMMDD format.
Thanks for your help and patience!
Best regards,
Kris A.