Dim IMax As Long, BMax As Long, BCut As Long, CMax As Integer
Dim R As Long, C As Integer, MxR As Integer, MxC As Long, RCpo As Integer
Dim TMP As Worksheet, RDB As Worksheet
Dim TmpS As Variant, RdbS As Variant
Sub Init_RdbS_ER2()
'
' Init_ItemSheet Macro
' マクロ記録日 : 2008/10/8 ユーザー名 :寺田屋の龍馬
'
' RDBシートの初期化
' Eco_RDB【エコ・RDB】 Ver.2.0
TmpS = "Sheet1": RdbS = "Sheet2"
Set TMP = Worksheets(TmpS) Set RDB = Worksheets(RdbS)
MsgBox RdbS + " RDBシート初期化スタート! "
IMax = 1000000: BMax = 720: BCut = 320: RCpo = IMax \ 200
MxC = 202: MxR = (IMax / 200 \ 500) * (BMax + 2)
RDB.Range("A" + CStr(1) + ":IV65536").ClearContents
RDB.Cells(RCpo + 1, 1) = "=R" + CStr(RCpo + 2) + "C2"
RDB.Cells(1, 201) = "項 目 名"
RDB.Cells(2, 201) = 0
RDB.Cells(3, 201) = IMax
RDB.Cells(4, 201) = RCpo
RDB.Cells(1, 202) = 1
RDB.Cells(2, 202) = 0
RDB.Cells(3, 202) = BMax
RDB.Cells(4, 202) = BCut
RDB.Cells(5, 202) = "$A1"
For R = RCpo + 1 To RCpo + MxR Step BMax + 2
For C = 2 To MxC
RDB.Cells(R, C) = 0
Next
Next
MsgBox RdbS + " RDBシート初期化完了! "
End Sub