Hello team, can you please help me?
Thanks in advance.
I'm trying to imagine how to have a column that copy/paste the value from the previous cell, who gets the data through a formula. this through a VBA code.
So this is the formula used to populate column "B", which extracts the date from the "Entry Date" sheet.
=INDEX('Entry Date'!$A$2:$G$3,MATCH(B$1,'Entry Date'!$A$2:$A$3,0),MATCH($A2,'Entry Date'!$A$2:$G$2,0))
and what I want is to populate column "C" with the date value, each time I populate the next empty cell in column "B". this to properly use the date filter and be able to use that column for an "=IF AND AND" formula.
and I want this to happen, as it occurs on column F, every time I populate or change the status in column E.
attached you will find the example performed from the complete data.
and this is the VBA code used to auto-populate the column F
Private Sub Worksheet_Change(ByVal Target As Range)
'Update DATES
Dim WorkRng As Range
Dim Rng As Range
Dim xOffsetColumn As Integer
Set WorkRng = Intersect(Application.ActiveSheet.Range("E:E"), Target)
xOffsetColumn = 1
If Not WorkRng Is Nothing Then
Application.EnableEvents = False
For Each Rng In WorkRng
If Not VBA.IsEmpty(Rng.Value) Then
Rng.Offset(0, xOffsetColumn).Value = Now
Rng.Offset(0, xOffsetColumn).NumberFormat = "dd/mm/yyyy"
Else
Rng.Offset(0, xOffsetColumn).ClearContents
End If
Next
Application.EnableEvents = True
End If
End Sub
Thanks in advance.
I'm trying to imagine how to have a column that copy/paste the value from the previous cell, who gets the data through a formula. this through a VBA code.
So this is the formula used to populate column "B", which extracts the date from the "Entry Date" sheet.
=INDEX('Entry Date'!$A$2:$G$3,MATCH(B$1,'Entry Date'!$A$2:$A$3,0),MATCH($A2,'Entry Date'!$A$2:$G$2,0))
and what I want is to populate column "C" with the date value, each time I populate the next empty cell in column "B". this to properly use the date filter and be able to use that column for an "=IF AND AND" formula.
and I want this to happen, as it occurs on column F, every time I populate or change the status in column E.
attached you will find the example performed from the complete data.
Invoice No. | Shipment Date | Paste Date As ValueColumn | Status | Last Update | |
Data 1 | 09/11/2019 | Must Reject | 30/12/2019 | ||
Data 2 | 08/11/2019 | Passed | 30/12/2019 | ||
Data 3 | 01/11/2019 | ||||
Data 4 | 01/11/2019 | Passed | 30/12/2019 | ||
Data 5 | 01/11/2019 | ||||
Data 6 | 05/11/2019 | ||||
Data 7 |
and this is the VBA code used to auto-populate the column F
Private Sub Worksheet_Change(ByVal Target As Range)
'Update DATES
Dim WorkRng As Range
Dim Rng As Range
Dim xOffsetColumn As Integer
Set WorkRng = Intersect(Application.ActiveSheet.Range("E:E"), Target)
xOffsetColumn = 1
If Not WorkRng Is Nothing Then
Application.EnableEvents = False
For Each Rng In WorkRng
If Not VBA.IsEmpty(Rng.Value) Then
Rng.Offset(0, xOffsetColumn).Value = Now
Rng.Offset(0, xOffsetColumn).NumberFormat = "dd/mm/yyyy"
Else
Rng.Offset(0, xOffsetColumn).ClearContents
End If
Next
Application.EnableEvents = True
End If
End Sub