[vba] [vba] 활성화된 엑셀창의 선택한 셀(Selection) / Selection 오류시 / TextBox를 활용한 지정한 영역…
하나를하더라도최선을
2022-10-16 18:11
2,320
0
본문
ActiveWindow.ActiveCell
활용예:)
Private Sub TextBox1_Change()
Dim T As String, C As Range
T = Mid(TextBox1, 1, 1)
Set C = ActiveWindow.ActiveCell
If Application.Intersect(Range("B3:I20"), C) Is Nothing Then Exit Sub
If Len(C) Then C.Next.Activate: Set C = ActiveWindow.ActiveCell
If Application.Intersect(Range("B3:I20"), C) Is Nothing Then Cells(C.Row + 1, 2).Activate
ActiveWindow.ActiveCell = T
TextBox1.Activate
TextBox1 = Mid(TextBox1, 2)
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
If Not Application.Intersect(Range("B3:I20"), Target) Is Nothing Then TextBox1.Activate
End Sub
댓글목록0