C
captedgar
Hi there
My Excel Vba shown below inserts time() into a particular cell on m
sheet.
Once inserted, is it possible to clear this cell before my vba code i
re-run?.
My VBA is only entering the time() once and not re-insering the time(
if i change the same cell values after some time i.e.
please advice
Below is my code which inserts time() into a cell.
Private Sub DateModifier(ByVal strTarget As String, ByVal strDestinatio
As String)
' Checks for a Yes or NA or RB(Rollback) value in strTarget and i
found, modifies the cell in strDestination
If (Range(strTarget + strCurrentRow).Value2 = "Yes") Then
If (Range(strDestination + strCurrentRow).Value2 = "") Then
Range(strDestination + strCurrentRow).Value2 = StaticTime
End If
' Check to see if Log has been rolled back
If (Range(strDestination + strCurrentRow).Value2 Like ("Rolle
Back*")) Then
Range(strDestination + strCurrentRow).Value2 = StaticTime
End If
End If
' Check for an NA status
If (Range(strTarget + strCurrentRow).Value2 = "NA") Then
If (Range(strDestination + strCurrentRow).Value2 = "") Then
Range(strDestination + strCurrentRow).Value2 = "NA"
End If
End If
' Check to see if strTarget changes to "No" but originally was yes
' (if a value is in strDestination we assume a log has happened)
' and append the log with Rolled Back and the date
If (Range(strTarget + strCurrentRow).Value2 = "RB") Then
If Not (Range(strDestination + strCurrentRow).Value2 = "") Then
If Not (Range(strDestination + strCurrentRow).Value2 Lik
"*RB*") Then
Range(strDestination + strCurrentRow).Value2 = "RB"
StaticTime
End If
End If
End If
End Su
My Excel Vba shown below inserts time() into a particular cell on m
sheet.
Once inserted, is it possible to clear this cell before my vba code i
re-run?.
My VBA is only entering the time() once and not re-insering the time(
if i change the same cell values after some time i.e.
please advice
Below is my code which inserts time() into a cell.
Private Sub DateModifier(ByVal strTarget As String, ByVal strDestinatio
As String)
' Checks for a Yes or NA or RB(Rollback) value in strTarget and i
found, modifies the cell in strDestination
If (Range(strTarget + strCurrentRow).Value2 = "Yes") Then
If (Range(strDestination + strCurrentRow).Value2 = "") Then
Range(strDestination + strCurrentRow).Value2 = StaticTime
End If
' Check to see if Log has been rolled back
If (Range(strDestination + strCurrentRow).Value2 Like ("Rolle
Back*")) Then
Range(strDestination + strCurrentRow).Value2 = StaticTime
End If
End If
' Check for an NA status
If (Range(strTarget + strCurrentRow).Value2 = "NA") Then
If (Range(strDestination + strCurrentRow).Value2 = "") Then
Range(strDestination + strCurrentRow).Value2 = "NA"
End If
End If
' Check to see if strTarget changes to "No" but originally was yes
' (if a value is in strDestination we assume a log has happened)
' and append the log with Rolled Back and the date
If (Range(strTarget + strCurrentRow).Value2 = "RB") Then
If Not (Range(strDestination + strCurrentRow).Value2 = "") Then
If Not (Range(strDestination + strCurrentRow).Value2 Lik
"*RB*") Then
Range(strDestination + strCurrentRow).Value2 = "RB"
StaticTime
End If
End If
End If
End Su