Gandalf
Member
Hello everyone,
I hope you are all well.
I am sure someone will be able to help with this. I have a textbox on and excel sheet that I want to position according to whether the active cell is within one of 3 ranges or do nothing if the active cell is outside of these ranges. The code below does not seem to work
Thank you for any help
Gandalf
I hope you are all well.
I am sure someone will be able to help with this. I have a textbox on and excel sheet that I want to position according to whether the active cell is within one of 3 ranges or do nothing if the active cell is outside of these ranges. The code below does not seem to work
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Me.Range("U1").Value = "=ListPupils!" & ActiveCell.Address
If Intersect(ActiveCell, Range("V6:AN19")) Then
TxtBoxEnList.Top = 316
TxtBoxEnList.Left = 1041
ElseIf Intersect(ActiveCell, Range("V50:AN63")) Then
TxtBoxEnList.Top = 933
TxtBoxEnList.Left = 1041
ElseIf Intersect(ActiveCell, Range("V94:AN107")) Then
TxtBoxEnList.Top = 1548
TxtBoxEnList.Left = 1041
End If
End Sub
Thank you for any help
Gandalf