Hello, i have an issue i am looking to resolve, i have a userform that opens up with various options on Sheet3 , the problem is i have a checkbox on it that when selected will copy and paste information to a different sheet (Sheet4) on Sheet 4 in the code is a timestamp code , the code works fine if i am manually typing in the information , but it will not timestamp the target cell after the checkbox macro is finished , can someone help me figure out a code to put in either the check box code or sheet code to trigger an event that causes the target cell to trigger the update after clicking the check box , NOTE** after performing the copy paste function from the userform if i double click the target cell that was pasted to it will trigger the timestamp event**
code for userform is as follows-
Code for Sheet4 Timestamp is as follows-
code for userform is as follows-
VBA Code:
Private Sub CheckBox130_Click()
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim n As Long
Dim EmtC As Long
If txtRMBK.Value = "" Or txtRMBK.ListIndex = -1 Then
MsgBox "Choose Room/Bunk"
txtRMBK.SetFocus
Exit Sub
End If
With Sheets("Daily POB") 'fit to the name of your sheet
If txtRMBK.Value < 51 Then
n = txtRMBK.Value + 2
.Cells(n, "C").Copy
Else
n = txtRMBK.Value - 48
.Cells(n, "M").Copy
End If
End With
With Sheets("Arrivals-Departures")
EmtC = .Range("C" & Rows.Count).End(xlUp).Row + 1
.Range("C" & EmtC).PasteSpecial Paste:=xlPasteValues
End With
With Sheets("Daily POB") 'fit to the name of your sheet
If txtRMBK.Value < 51 Then
n = txtRMBK.Value + 2
.Cells(n, "F").Copy
Else
n = txtRMBK.Value - 48
.Cells(n, "P").Copy
End If
End With
With Sheets("Arrivals-Departures")
EmtC = .Range("D" & Rows.Count).End(xlUp).Row + 1
.Range("D" & EmtC).PasteSpecial Paste:=xlPasteValues
End With
With Sheets("Daily POB") 'fit to the name of your sheet
If txtRMBK.Value < 51 Then
n = txtRMBK.Value + 2
.Cells(n, "A").Copy
Else
n = txtRMBK.Value - 48
.Cells(n, "L").Copy
End If
End With
With Sheets("Arrivals-Departures")
EmtC = .Range("E" & Rows.Count).End(xlUp).Row + 1
.Range("E" & EmtC).PasteSpecial Paste:=xlPasteValues
End With
Sheets("Arrivals-Departures").Select
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Code for Sheet4 Timestamp is as follows-
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
If Target.Count > 1 Then Exit Sub ' this stops code error if more than one cell is changed at once
If Not Application.Intersect(Target, Range("C5:C49,L5:L49")) Is Nothing Then ' indicates the Target range
Target.Offset(, -2) = Format(Now, "m/d/yy hh:mm")
End If
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub