Macro/投稿/183

http://sakura.qp.land.to/?Macro%2F%C5%EA%B9%C6%2F183


Top > Macro > 投稿 > 183

物理桁位置移動

  • ページ: Macro/投稿
  • 作者: maru
  • カテゴリー: vbs
  • 投稿日: 2007-11-14 (水) 07:24:45

メッセージ

  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
'-------------------
'GoToColm.vbs
'指定の桁に移動
'>>data:6460 じゅうじ-改
'-------------------
 
Option Explicit
 
Call main
 
Private Sub main()
    Dim sNum, iNum, iMax
    '移動先の桁を取得
    sNum = InputBox("移動後の桁位置を指定してください." _
                    , "指定の桁へ移動")
 
    '数値以外ならキャンセル
    If Not IsNumeric(sNum) Then
        MsgBox "数値以外が入力されました."
        Exit Sub
    End If
    iNum = CLng(sNum)
 
    '行末桁より大きければ行末へ移動
'   Editor.GoLineEnd
    iMax = CLng(ExpandParameter("$x"))
'   If iNum >= iMax Then Exit Sub
    If iNum < iMax Then
        'カーソル位置が指定桁より小さくなるまで左移動
'       Editor.GoLineTop
        Do While CLng(ExpandParameter("$x")) > iNum
            Editor.Left
        Loop
    Else
        'カーソル位置が指定桁より大きくなるまで右移動
'       Editor.GoLineTop
        Do While CLng(ExpandParameter("$x")) < iNum
            Editor.Right
        Loop
    End If
 
End Sub


URL B I U SIZE Black Maroon Green Olive Navy Purple Teal Gray Silver Red Lime Yellow Blue Fuchsia Aqua White

リロード   新規 編集 凍結 差分 添付 複製 名前変更   ホーム 一覧 単語検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS
Last-modified: 2007-11-14 (水) 15:33:50 (6000d)