| 
    
     |  | Sub 入力設定操作説明() 
 With Assistant.NewBalloon
 .BalloonType = msoBalloonTypeBullets
 .Icon = msoIconTip
 .Button = msoButtonSetOK
 .Heading = "{ul 1}{cf 1}《 入力設定 操作説明 》{ul 0}   "
 .Text = String(40, " ")
 
 .Labels(1).Text = "{cf 252}【 入力範囲設定 】" & vbLf & _
 "{cf 2} [入力範囲ロック]" & vbLf & _
 "{cf 0}  現在の選択範囲セル(トビトビ範囲可)のみを移動範囲として" & vbLf & _
 "  ロック出来ます。" & vbLf & _
 "{cf 2} [一時解除]" & vbLf & _
 "{cf 0}  一時的にシート保護解除して、編集可状態に出来ます。" & vbLf & _
 "{cf 2} [再設定]" & vbLf & _
 "{cf 0}  再び、前の領域設定に戻します。 ファイルを開いた直後は、" & vbLf & _
 "  解除されているので再設定が必要となります。" & vbLf & _
 "   ( 2002は、保存されているそうです。)"
 .Labels(2).Text = "{cf 252}【 日本語入力 】" & vbLf & _
 "{cf 0}  現在の選択範囲セルを好みの日本語入力状態にロック出来ます。" & vbLf & _
 "  文章を入力するセルには、[オン固定]" & vbLf & _
 "  数値を入力するセルには、[オフ固定]" & vbLf & _
 "   とすると円滑にデータ入力する事が出来ます。"
 .Labels(3).Text = "{cf 252}【 Enter移動 】" & vbLf & _
 "{cf 0}  [Enter]後の移動方向の設定です。"
 .Show
 
 End With
 
 End Sub
 Sub 入力設定操作説明97()
 
 With Assistant.NewBalloon
 .BalloonType = msoBalloonTypeBullets
 .Icon = msoIconTip
 .Button = msoButtonSetOK
 .Heading = "《 入力設定 操作説明 》"
 .Text = String(40, " ")
 
 .Labels(1).Text = "【 入力範囲設定 】" & vbLf & _
 " [入力範囲ロック]" & vbLf & _
 "  現在の選択範囲セル(トビトビ範囲可)のみを移動範囲として" & vbLf & _
 "  ロック出来ます。" & vbLf & _
 " [一時解除]" & vbLf & _
 "  一時的にシート保護解除して、編集可状態に出来ます。" & vbLf & _
 " [再設定]" & vbLf & _
 "  再び、前の領域設定に戻します。 ファイルを開いた直後は、" & vbLf & _
 "  解除されているので再設定が必要となります。" & vbLf & _
 "   ( 2002は、保存されているそうです。)"
 .Labels(2).Text = "【 日本語入力 】" & vbLf & _
 "  現在の選択範囲セルを好みの日本語入力状態にロック出来ます。" & vbLf & _
 "  文章を入力するセルには、[オン固定]" & vbLf & _
 "  数値を入力するセルには、[オフ固定]" & vbLf & _
 "   とすると円滑にデータ入力する事が出来ます。"
 .Labels(3).Text = "【 Enter移動 】" & vbLf & _
 "  [Enter]後の移動方向の設定です。"
 .Show
 
 End With
 
 End Sub
 Sub 入力範囲ロック()
 
 ActiveSheet.Unprotect
 Cells.Locked = True
 Selection.Locked = False
 ActiveSheet.EnableSelection = xlUnlockedCells
 ActiveSheet.Protect
 
 End Sub
 Sub 一時解除()
 
 ActiveSheet.Unprotect
 
 End Sub
 Sub 再設定()
 
 ActiveSheet.Unprotect
 ActiveSheet.EnableSelection = xlUnlockedCells
 ActiveSheet.Protect
 
 End Sub
 Private Sub 再表示()
 
 Application.CommandBars("PikaBar").Controls("入力設定").Visible = True
 
 End Sub
 
 'ボタンに対応
 Private Sub 変換_1()
 If (ActiveSheet.ProtectContents) Or (TypeName(Selection) <> "Range") Then
 エラーメッセージ
 Else
 日本語変換 xlIMEModeOn
 End If
 End Sub
 Private Sub 変換_2()
 If (ActiveSheet.ProtectContents) Or (TypeName(Selection) <> "Range") Then
 エラーメッセージ
 Else
 日本語変換 xlIMEModeOff
 End If
 End Sub
 Private Sub 変換_3()
 If (ActiveSheet.ProtectContents) Or (TypeName(Selection) <> "Range") Then
 エラーメッセージ
 Else
 日本語変換 xlIMEModeNoControl
 End If
 End Sub
 Private Sub 方向_1()
 移動方向 1
 End Sub
 Private Sub 方向_2()
 移動方向 2
 End Sub
 Private Sub 方向_3()
 移動方向 3
 End Sub
 Private Sub 方向_4()
 移動方向 4
 End Sub
 Private Sub 方向_5()
 移動方向 5
 End Sub
 Private Sub 入力設定ON()
 Dim Iflg, II%
 Application.StatusBar = "入力設定"
 Dim myCBpup As CommandBarPopup
 '現在の状況を判定
 Dim vd As Validation
 Set vd = Selection.Validation
 Iflg = -1
 On Error Resume Next
 Iflg = vd.IMEMode
 On Error GoTo 0
 If Iflg = 0 Then Iflg = 3
 Set vd = Nothing
 '
 On Error Resume Next
 Set myCBpup = Application.CommandBars("PikaBar") _
 .Controls("入力設定").Controls(3)
 On Error GoTo 0
 '目玉付加
 If Not myCBpup Is Nothing Then
 For II% = 1 To 3
 With myCBpup.Controls(II%)
 If II% = Iflg Then
 .FaceId = 446
 Else
 .FaceId = 1
 .Enabled = True
 End If
 End With
 Next
 End If
 '
 With Application
 Iflg = 5
 If .MoveAfterReturn = False Then
 Iflg = 5
 Else
 Select Case .MoveAfterReturnDirection
 Case xlDown:   Iflg = 1
 Case xlToRight: Iflg = 2
 Case xlUp:    Iflg = 3
 Case xlToLeft:  Iflg = 4
 Case Else:    Iflg = 5
 End Select
 End If
 End With
 Set myCBpup = Nothing
 On Error Resume Next
 Set myCBpup = Application.CommandBars("PikaBar") _
 .Controls("入力設定").Controls(4)
 On Error GoTo 0
 '目玉付加
 If Not myCBpup Is Nothing Then
 For II% = 1 To 5
 With myCBpup.Controls(II%)
 If II% = Iflg Then
 .FaceId = 446
 Else
 .FaceId = 1
 .Enabled = True
 End If
 End With
 Next
 End If
 End Sub
 '処理2
 Private Sub 日本語変換(arg1 As Long)
 With Selection.Validation
 On Error Resume Next
 .Delete
 On Error GoTo 0
 .Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator:=xlBetween
 'ここが分岐
 .IMEMode = arg1
 End With
 End Sub
 '処理3
 Private Sub 移動方向(tp As Integer)
 With Application
 If tp = 5 Then
 .MoveAfterReturn = False
 Else
 .MoveAfterReturn = True
 Select Case tp
 Case 1: .MoveAfterReturnDirection = xlDown
 Case 2: .MoveAfterReturnDirection = xlToRight
 Case 3: .MoveAfterReturnDirection = xlUp
 Case 4: .MoveAfterReturnDirection = xlToLeft
 End Select
 End If
 End With
 End Sub
 
 |  |