JohnGow383
Board Regular
- Joined
- Jul 6, 2021
- Messages
- 141
- Office Version
- 2013
- Platform
- Windows
Hello all,
I have a small issue.
I have a worksheet_change event that calls a UserForm to enter a value into a text box. The trigger range is in Column W range W2:W200. The textbox value is autofilled into a cell on the same row as the triggered Worksheet_Change row. I am currently using
However, this will only work when the user presses enter on the trigger cell and it looks for an offset of -1 rows. If the value is deleted, or if the user is using tab or clicks away using the mouse, then the Textbox 1 value will fill into the wrong cell.
I can identify the last changed cell within the Sheet code by using a range variable
,
however, I am not sure how to have this variable as a global setting so it can be used in my UserForm code.
Any ideas? Any workarounds.
Any help appreciated, ty.
I have a small issue.
I have a worksheet_change event that calls a UserForm to enter a value into a text box. The trigger range is in Column W range W2:W200. The textbox value is autofilled into a cell on the same row as the triggered Worksheet_Change row. I am currently using
VBA Code:
TextBox1 = ws1.Cells(ActiveCell.Row, 24).Offset(-1, 0).Value
I can identify the last changed cell within the Sheet code by using a range variable
VBA Code:
LastCell = Target
VBA Code:
MsgBox LastCell.Row
Any ideas? Any workarounds.
Any help appreciated, ty.