![]() |
Changing Cell formats to date fields automatically
I have a cell in which its value is determined by 3 other cells in order to
form a Date type of entire. Example: Cells O17, O18, and O19 are determined by combo box selections. O17 = Month O18 = Day O19 = Year Let's say that cell O20 uses the following formula: =O17 & " " & O18 & "," & " " & O19 Cell O20 would be displayed as: April 1, 2005 Is there a way I can force cell O20 to be seen as a date? I've adjusted the cell formatting to 'Date' and I used the type as 'March 14, 1998'. However, cell O20 is not in a Date format. If I click in the formula bar for cell O20 and press enter, it then switches to the Date format. I need for this to be done automatically without me having to click in each cell. I'm already using a macro to copy this cell from a different worksheet. Can I add something to the macro to force this into a date fomat? Thanks, Paul |
One way:
=DATEVALUE(O18 & O17 & O19) In article , "PCLIVE" wrote: I have a cell in which its value is determined by 3 other cells in order to form a Date type of entire. Example: Cells O17, O18, and O19 are determined by combo box selections. O17 = Month O18 = Day O19 = Year Let's say that cell O20 uses the following formula: =O17 & " " & O18 & "," & " " & O19 Cell O20 would be displayed as: April 1, 2005 Is there a way I can force cell O20 to be seen as a date? I've adjusted the cell formatting to 'Date' and I used the type as 'March 14, 1998'. However, cell O20 is not in a Date format. If I click in the formula bar for cell O20 and press enter, it then switches to the Date format. I need for this to be done automatically without me having to click in each cell. I'm already using a macro to copy this cell from a different worksheet. Can I add something to the macro to force this into a date fomat? Thanks, Paul |
You are awesome!
Thank you. Paul "JE McGimpsey" wrote in message ... One way: =DATEVALUE(O18 & O17 & O19) In article , "PCLIVE" wrote: I have a cell in which its value is determined by 3 other cells in order to form a Date type of entire. Example: Cells O17, O18, and O19 are determined by combo box selections. O17 = Month O18 = Day O19 = Year Let's say that cell O20 uses the following formula: =O17 & " " & O18 & "," & " " & O19 Cell O20 would be displayed as: April 1, 2005 Is there a way I can force cell O20 to be seen as a date? I've adjusted the cell formatting to 'Date' and I used the type as 'March 14, 1998'. However, cell O20 is not in a Date format. If I click in the formula bar for cell O20 and press enter, it then switches to the Date format. I need for this to be done automatically without me having to click in each cell. I'm already using a macro to copy this cell from a different worksheet. Can I add something to the macro to force this into a date fomat? Thanks, Paul |
in O20 use
=DATEVALUE(O17 & " " & O18 & "," & " " & O19) "PCLIVE" wrote: I have a cell in which its value is determined by 3 other cells in order to form a Date type of entire. Example: Cells O17, O18, and O19 are determined by combo box selections. O17 = Month O18 = Day O19 = Year Let's say that cell O20 uses the following formula: =O17 & " " & O18 & "," & " " & O19 Cell O20 would be displayed as: April 1, 2005 Is there a way I can force cell O20 to be seen as a date? I've adjusted the cell formatting to 'Date' and I used the type as 'March 14, 1998'. However, cell O20 is not in a Date format. If I click in the formula bar for cell O20 and press enter, it then switches to the Date format. I need for this to be done automatically without me having to click in each cell. I'm already using a macro to copy this cell from a different worksheet. Can I add something to the macro to force this into a date fomat? Thanks, Paul |
All times are GMT +1. The time now is 03:01 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com