Dim MxR As Long, MxC As Integer, IMax As Long, BfMx As Long
Dim InsDt As Variant, InsRn As Variant, Rn As Long, Cn As LongDim MxDt As Long, RCpo As Integer, BMax As Integer, BCut As Integer, TMP1()
Dim MST As Worksheet, IDX As Worksheet
Dim MstS As String, IdxS As String
Sub Del_Dat_ER2()
'
' Del_Dat Macro
' マクロ記録日 : 2008/10/8 ユーザー名 :寺田屋の龍馬
'
' RDBシートよりマスタデータ+IDを削除
' Eco_RDB【エコ・RDB】 Ver.2.0
ST$ = Time$
Application.ScreenUpdating = False
MstS = "Sheet1": IdxS = "Sheet2"
Set MST = Worksheets(MstS) Set IDX = Worksheets(IdxS)
MxC = 1 'RDBシートの1~200列 MxR = 1 'RDBシートの1~200列の1~5000行
InsCo = 0: InsRn = 10001
MxDt = IDX.Cells(2, 201): BfMx = MxDt
IMax = IDX.Cells(3, 201)
RCpo = IDX.Cells(4, 201)
Cl = IDX.Cells(5, 201)
BMax = IDX.Cells(3, 202)
BCut = IDX.Cells(4, 202)
TMP1() = IDX.Range(IDX.Cells(RCpo + 1, 1), IDX.Cells(RCpo + 4001, 1))
For Cn = 1 To MxC
For Rn = 1 To MxR
DelDt = IDX.Cells(Rn, Cn) '削除するマスタデータを変数にセット
DelRn = Cn * 10000 + Rn '削除するレコード番号を変数にセット
'RDBシートよりマスタデータとインデックスを削除 Call Del_Dt_ER2(IDX, IDX, DelDt, DelRn, Cl, MxDt, RCpo, BMax, BCut, TMP1())
Next Next
MsgBox "ID削除完了! " + Chr$(13) + Chr$(13) + "開始 : " + ST$ + Chr$(13) + Chr$(13) + "終了 : " + Time$ + Chr$(13) + Chr$(13) + "ID削除件数 =" + Str(BfMx - MxDt) + " 件"
Application.ScreenUpdating = True
End Sub