[vba] 활성화된 엑셀창의 선택한 셀(Selection) / Selection 오류시 / TextBox를 활용한 지정한 영역 한글자씩 입력받기 > vb6.0/vba

본문 바로가기

vb6.0/vba

[vba] [vba] 활성화된 엑셀창의 선택한 셀(Selection) / Selection 오류시 / TextBox를 활용한 지정한 영역…

회원사진
하나를하더라도최선을
2022-10-16 18:11 2,320 0

본문



ActiveWindow.ActiveCell 


활용예:)


0c10c0d0f383c338144a996f6c17a753_1665911452_2629.png
 

Private Sub TextBox1_Change()
    Dim T As String, C As Range
    T = Mid(TextBox1, 11)
    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 + 12).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

등록된 댓글이 없습니다.
게시판 전체검색