Hi everyone,
I'm trying to figure out how to add two separate values with double clicking in cells within a specified range. I found a string of vba that helps me do one of the values that I'm looking to populate but I know that you cannot enter two of these strings into the background of a worksheet in vba. I'm trying to see if there's a way to get the code entered that it can enter the date in a set column/range and enter the username in another. Currently I can only get one or the other. Thanks for the help in advance!
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("b1:B10")) Is Nothing Then
Cancel = True
Target.Formula = Date
End If
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("b1:B10")) Is Nothing Then
Cancel = True
Target.value = environ("username")
End If
End Sub
I'm trying to figure out how to add two separate values with double clicking in cells within a specified range. I found a string of vba that helps me do one of the values that I'm looking to populate but I know that you cannot enter two of these strings into the background of a worksheet in vba. I'm trying to see if there's a way to get the code entered that it can enter the date in a set column/range and enter the username in another. Currently I can only get one or the other. Thanks for the help in advance!
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("b1:B10")) Is Nothing Then
Cancel = True
Target.Formula = Date
End If
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("b1:B10")) Is Nothing Then
Cancel = True
Target.value = environ("username")
End If
End Sub