|
>>DAtesortが2ヶ所あるんですけどその2ヶ所でエラーが出てるみたいなんですけど・・・
>
DAtesortて、DataSortの事ですか?
ひょっとして、以下の2つのプロシージャが無い(記述漏れ)のでは?
Private Sub DataSort(rngScope As Range, _
rngKey As Range, _
Optional lngSortOrder As Long = xlAscending, _
Optional lngOrientation As Long = xlTopToBottom)
rngScope.Sort _
Key1:=rngKey, Order1:=lngSortOrder, _
Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=lngOrientation, SortMethod:=xlStroke
End Sub
Private Sub GetSheets(vntName As Variant, strTop As String, rngResult As Range)
Dim i As Long
Dim lngRows As Long
Dim wksMark As Worksheet
'シートの存在確認
For Each wksMark In Worksheets
If StrComp(wksMark.Name, vntName, vbTextCompare) = 0 Then
Exit For
End If
Next wksMark
'もし、シートが無いなら
If wksMark Is Nothing Then
'シートを追加して、シート名を設定
Set wksMark = Worksheets.Add(After:=rngResult.Parent)
wksMark.Name = vntName
Else
'データを消去
wksMark.UsedRange.ClearComments
End If
Set rngResult = wksMark.Range(strTop)
Set wksMark = Nothing
End Sub
|
|