auto populate with date + 6 months

flybynyte

New Member
Joined
Jun 5, 2018
Messages
10
Hi Everyone,

I'm in desperate need for a unction/rule.

So, (this is embarrassing) a bunch of people are imputing dates in column G in a spread sheet; they are all different dates. These people need these dates plus 6 months to auto populate in column F.

For instance: column G is 04/30/18; column F needs to auto populate 10/30/2018 as soon as "enter" is hit.

I told them to type it in, or to use EDATE, i got blank stares.

Please help me.

Thank you,

Flybynyte
PS. Stay Sexy...
 

jproffer

Well-known Member
Joined
Dec 15, 2004
Messages
2,643
Couple ways...one easy, one more "round-a-bout" way of doing it....

Excel 2013/2016
EFG
16/4/201812/4/201812/4/2018
25/2/201811/2/201811/2/2018
31/14/20187/14/20187/14/2018

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
F1=DATE(YEAR(E1),MONTH(E1)+6,DAY(E1))
G1=EDATE(E1,6)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>


OHHHH, I just read on down....so event code in the worksheet is better for them?
 
Last edited:

jproffer

Well-known Member
Joined
Dec 15, 2004
Messages
2,643
This:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("G:G")) Is Nothing Then
    Range("F" & Target.Row).Value = WorksheetFunction.EDate(Target.Value, 6)
End If
End Sub
In the worksheet module would do what they want. You'll have to format column F as Date
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,295
Try this:
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("G:G")) Is Nothing Then
    Target.Offset(, 1).Value = DateAdd("M", 6, Target.Value)
End If
End Sub
 

flybynyte

New Member
Joined
Jun 5, 2018
Messages
10
It didn't work.

Thanks for trying to help me.
I really thought there was a function/rule that those that.
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
I really thought there was a function/rule that those that.
There is, it's called EDATE.
The fact that your users don't want to use it doesn't change that.

The users don't have to use EDATE.
You put it in for them before you give them the sheet.
They still put the dates in G, while it updates F with +6months.
 
Last edited:

Forum statistics

Threads
1,082,360
Messages
5,364,920
Members
400,815
Latest member
Joaquin Phoenix

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top