Converting date in VBA Excel
Solved/Closed
Hello,
I have a spreadsheet that has:
Column A: Year
Column B: Month
Column C: Day
Is there a way to convert these 3 columns into the actual date in VB code? I have a form that I need a text box to populate the date from these three columns in the spreadsheet. The reason I simply did not use the date format in the spreadsheet is because the user will be filtering many dates and I was afraid the advance filter would be a little more complicated for them. Thanks if anyone can help!
I have a spreadsheet that has:
Column A: Year
Column B: Month
Column C: Day
Is there a way to convert these 3 columns into the actual date in VB code? I have a form that I need a text box to populate the date from these three columns in the spreadsheet. The reason I simply did not use the date format in the spreadsheet is because the user will be filtering many dates and I was afraid the advance filter would be a little more complicated for them. Thanks if anyone can help!
Related:
- Converting date in VBA Excel
- Convert number to words in excel - Guide
- Vba case like - Guide
- How to change date format in excel - Guide
- Gif in excel - Guide
- Excel mod apk for pc - Download - Spreadsheets
3 responses
I dont know how to do that in VB code but you can use such a formula
=B1&"/"&C2&"/"&A2
and change the format of the cell to date
I hope it helps.
=B1&"/"&C2&"/"&A2
and change the format of the cell to date
I hope it helps.
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Dec 28, 2010 at 09:32 AM
Dec 28, 2010 at 09:32 AM
Hi Roger,
Looking for something like this:
Trowa
Looking for something like this:
ActiveCell.Formula = "=DATE(A2,B2,C2)"Best regards,
Trowa