シートのカラムのダブルクリック列をソートする、よく使うサブルーチンライブラリ
シートのカラムのダブルクリック列をソートする
書式 Function sSort(Title_Row, topCol, endCol, keys(), rr, cc, fillerL)
Title_Row:タイトル行(この行がダブルクリックされたらカラムソートを実行
topCol:開始カラム
endCol:終了カラム
keys():ソート方向スタック
rr:クリック行
cc:クリックカラム
fillerL:空欄許可
topCol:開始カラム
endCol:終了カラム
keys():ソート方向スタック
rr:クリック行
cc:クリックカラム
fillerL:空欄許可
使用例
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim field(10) 'グローバル変数
Dim ssht
Dim isr, isc
Dim topCol, endCol
Set ssht = ActiveSheet
isr = 5 'データ開始行
isc = 2 'データ開始桁
Dim rr, cc
Dim fl
rr = Target.Row
cc = Target.Column
fl = 1
topCol = isc
endCol = LastRange.LastP(ssht, "col", isr – 1, isc, fl)
Call SheetUTL.sSort(isr – 1, topCol, endCol, sFlds(), rr, cc, fl)
:
:
: