ACTInstructor
New Member
- Joined
- Feb 3, 2023
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Good Day -
Having a hard time getting my code right. What I would like to do is the following:
Click in a given cell, and using THAT row, find the 1st empty cell and insert the current date. The date part is easy enough, its finding the 1st empty cell in the row i clicked on.
The code I've been toying with in various manners is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim xRow As Integer
Dim xCol As String
xRow = Target.Row
xCol = Target.Column
If Not Intersect(Range(Selection.Address), Target) Is Nothing Then
'Rows(xRow).End(xlToRight).Offset(0, 1).Select
'Range (Selection.Address), Target.End(xlToRight).Offset(0, 1).Select
End If
End Sub
any help or guidance is highly appreciated.
Having a hard time getting my code right. What I would like to do is the following:
Click in a given cell, and using THAT row, find the 1st empty cell and insert the current date. The date part is easy enough, its finding the 1st empty cell in the row i clicked on.
The code I've been toying with in various manners is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim xRow As Integer
Dim xCol As String
xRow = Target.Row
xCol = Target.Column
If Not Intersect(Range(Selection.Address), Target) Is Nothing Then
'Rows(xRow).End(xlToRight).Offset(0, 1).Select
'Range (Selection.Address), Target.End(xlToRight).Offset(0, 1).Select
End If
End Sub
any help or guidance is highly appreciated.