Capturing more than one date in the same cell

kralin

New Member
Joined
Dec 8, 2023
Messages
8
Office Version
  1. 2019
Platform
  1. Windows
Hello, I'm hoping someone may be able to help.

In one cell I have a field called 'contact date'. What I would like is to populate another cell with dates input into this cell.

I'd like users to be able to change the date in cell 1 - contact date - and for cell 2 to capture the first value input, then the second value and so on, ideally with a semi-colon separating the dates.

So my desired output would be

Contact Date Contact dates
03/01/2024 01/01/2024; 02/01/2024; 03/01/2024 etc


Hopefully this is possible - any assistance would be gratefully received.


Many thanks


EDIT: Am using Office Professional Plus 2019
 
Last edited by a moderator:

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
This will require you to use VBA to do this.
Right-click on the sheet tab name at the bottom of the screen, select "View Code", and paste this VBA code in the VB Editor window that pops up:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

'   Exit if multiple cells updated at once
    If Target.CountLarge > 1 Then Exit Sub
    
'   Exit if row 1 or column outside of A updates
    If Target.Row = 1 Or Target.Column > 1 Then Exit Sub
    
'   Exit if entry is blank
    If Target = "" Then Exit Sub
    
'   Populate column B
    If Target.Offset(0, 1) = "" Then
        Target.Offset(0, 1).NumberFormat = "@"
        Target.Offset(0, 1) = Format(Target, "mm/dd/yyyy")
    Else
        Target.Offset(0, 1) = Target.Offset(0, 1) & "; " & Format(Target, "mm/dd/yyyy")
    End If
    
End Sub
Now, as you make entries into column A under row 1, it will automatically update the corresponding column B row in the manner you want.
 
Upvote 0
Solution
We also see that you have Cross-posted this question in another forum.
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Capturing more than one date in the same cell
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
We also see that you have Cross-posted this question in another forum.
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Capturing more than one date in the same cell
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
Apologies
 
Upvote 0
Did my solution work for you?
 
Upvote 0
We also see that you have Cross-posted this question in another forum.
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Capturing more than one date in the same cell
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
This will require you to use VBA to do this.
Right-click on the sheet tab name at the bottom of the screen, select "View Code", and paste this VBA code in the VB Editor window that pops up:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

'   Exit if multiple cells updated at once
    If Target.CountLarge > 1 Then Exit Sub
   
'   Exit if row 1 or column outside of A updates
    If Target.Row = 1 Or Target.Column > 1 Then Exit Sub
   
'   Exit if entry is blank
    If Target = "" Then Exit Sub
   
'   Populate column B
    If Target.Offset(0, 1) = "" Then
        Target.Offset(0, 1).NumberFormat = "@"
        Target.Offset(0, 1) = Format(Target, "mm/dd/yyyy")
    Else
        Target.Offset(0, 1) = Target.Offset(0, 1) & "; " & Format(Target, "mm/dd/yyyy")
    End If
   
End Sub
Now, as you make entries into column A under row 1, it will automatically update the corresponding column B row in the manner you want.
Many thanks for taking the time and trouble to get back to me
 
Upvote 0
You are welcome.
I am glad my solution worked for you.
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,136
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top