'목록하단 광고 치환자(withSeok)
728x90

유튜버 엑사남님의 도움으로 완성하였습니다. ^^
엑셀 파일 다운로드 Ver-2

단순덧셈엑셀계산기-ver002.006.xlsb
0.03MB

Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Range("c2:c301")) Is Nothing Then
        If Target = "" Then
            Target = "1"
        Else
                If Target = "1" Then
                    Target = ""
                Else
                End If
        End If
    End If
Target.Offset(0, 1).Select
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
On Error GoTo ErrCode

    If Not Intersect(Target, Range("b2:b301")) Is Nothing Then
        Call 입력시작
    Else
        Call 입력완료
    End If
ErrCode:
End Sub
Sub 입력시작()
With Application
    .OnKey "0", "Input_0": .OnKey "1", "Input_1": .OnKey "2", "Input_2": .OnKey "3", "Input_3": .OnKey "4", "Input_4": .OnKey "5", "Input_5": .OnKey "6", "Input_6": .OnKey "7", "Input_7": .OnKey "8", "Input_8": .OnKey "9", "Input_9"
    .OnKey "{96}", "input_0": .OnKey "{97}", "input_1": .OnKey "{98}", "input_2": .OnKey "{99}", "input_3": .OnKey "{100}", "input_4": .OnKey "{101}", "input_5": .OnKey "{102}", "input_6": .OnKey "{103}", "input_7": .OnKey "{104}", "input_8": .OnKey "{105}", "input_9"
End With
End Sub
Sub 입력완료()
With Application
    .OnKey "0": .OnKey "1": .OnKey "2": .OnKey "3": .OnKey "4": .OnKey "5": .OnKey "6": .OnKey "7": .OnKey "8": .OnKey "9"
    .OnKey "{96}": .OnKey "{97}": .OnKey "{98}": .OnKey "{99}": .OnKey "{100}": .OnKey "{101}": .OnKey "{102}": .OnKey "{103}": .OnKey "{104}": .OnKey "{105}"
End With
End Sub
Sub 지우기()
    Range("B:B").ClearContents
    Range("B2").Select
End Sub

Sub input_0()
    Call InputValue(0)
End Sub

Sub input_1()
    Call InputValue(1)
End Sub

Sub input_2()
    Call InputValue(2)
End Sub

Sub input_3()
    Call InputValue(3)
End Sub

Sub input_4()
    Call InputValue(4)
End Sub

Sub input_5()
    Call InputValue(5)
End Sub

Sub input_6()
    Call InputValue(6)
End Sub

Sub input_7()
    Call InputValue(7)
End Sub

Sub input_8()
    Call InputValue(8)
End Sub

Sub input_9()
    Call InputValue(9)
End Sub
Sub InputValue(lngNum As Long)
    Selection.Offset(0, 0).Select
        If Selection.Offset(0, -1) = "" Then
            MsgBox "더이상 문항이 없습니다, 종료합니다."
            Call 입력완료
            Exit Sub
        End If
Selection = lngNum
Selection.Offset(1, 0).Select
End Sub

 

728x90

+ Recent posts