Hi. I have a code which works great, but, I would like to make it more readable. It starts off by defining many constants and dynamic ranges. However, I was wondering if someone could help me condense these sort of declarations at the beginning of the code..... take a look !
Dim arrmonth1, arrmonth2, arrmonth3, arrmonth4, _
arrmonth5, arrmonth6, arrmonth7, arrmonth8, _
arrmonth9, arrmonth10, arrmonth11, arrmonth12 As Variant
Dim rngmonth1, rngmonth2, rngmonth3, rngmonth4, _
rngmonth5, rngmonth6, rngmonth7, rngmonth8, _
rngmonth9, rngmonth10, rngmonth11, rngmonth12 As Range
Dim zm1, zm2, zm3, zm4, zm5, zm6, zm7, zm8, zm9, zm10, zm11, zm12 As Long
Set rngmonth1 = Range([D8], [D8].End(xlDown))
Set rngmonth2 = Range([I8], [I8].End(xlDown))
Set rngmonth3 = Range([N8], [N8].End(xlDown))
Set rngmonth4 = Range([S8], [S8].End(xlDown))
Set rngmonth5 = Range([X8], [X8].End(xlDown))
Set rngmonth6 = Range([AC8], [AC8].End(xlDown))
Set rngmonth7 = Range([AH8], [AH8].End(xlDown))
Set rngmonth8 = Range([AM8], [AM8].End(xlDown))
Set rngmonth9 = Range([AR8], [AR8].End(xlDown))
Set rngmonth10 = Range([AW8], [AW8].End(xlDown))
Set rngmonth11 = Range([BB8], [BB8].End(xlDown))
Set rngmonth12 = Range([BG8], [BG8].End(xlDown))
zm1 = rngmonth1.Rows.Count
zm2 = rngmonth2.Rows.Count
zm3 = rngmonth3.Rows.Count
zm4 = rngmonth4.Rows.Count
zm5 = rngmonth5.Rows.Count
zm6 = rngmonth6.Rows.Count
zm7 = rngmonth7.Rows.Count
zm8 = rngmonth8.Rows.Count
zm9 = rngmonth9.Rows.Count
zm10 = rngmonth10.Rows.Count
zm11 = rngmonth11.Rows.Count
zm12 = rngmonth12.Rows.Count
arrmonth1 = rngmonth1
arrmonth2 = rngmonth2
arrmonth3 = rngmonth3
arrmonth4 = rngmonth4
arrmonth5 = rngmonth5
arrmonth6 = rngmonth6
arrmonth7 = rngmonth7
arrmonth8 = rngmonth8
arrmonth9 = rngmonth9
arrmonth10 = rngmonth10
arrmonth11 = rngmonth11
arrmonth12 = rngmonth12
Thanks,
RET79
This message was edited by RET79 on 2002-04-01 06:52
Dim arrmonth1, arrmonth2, arrmonth3, arrmonth4, _
arrmonth5, arrmonth6, arrmonth7, arrmonth8, _
arrmonth9, arrmonth10, arrmonth11, arrmonth12 As Variant
Dim rngmonth1, rngmonth2, rngmonth3, rngmonth4, _
rngmonth5, rngmonth6, rngmonth7, rngmonth8, _
rngmonth9, rngmonth10, rngmonth11, rngmonth12 As Range
Dim zm1, zm2, zm3, zm4, zm5, zm6, zm7, zm8, zm9, zm10, zm11, zm12 As Long
Set rngmonth1 = Range([D8], [D8].End(xlDown))
Set rngmonth2 = Range([I8], [I8].End(xlDown))
Set rngmonth3 = Range([N8], [N8].End(xlDown))
Set rngmonth4 = Range([S8], [S8].End(xlDown))
Set rngmonth5 = Range([X8], [X8].End(xlDown))
Set rngmonth6 = Range([AC8], [AC8].End(xlDown))
Set rngmonth7 = Range([AH8], [AH8].End(xlDown))
Set rngmonth8 = Range([AM8], [AM8].End(xlDown))
Set rngmonth9 = Range([AR8], [AR8].End(xlDown))
Set rngmonth10 = Range([AW8], [AW8].End(xlDown))
Set rngmonth11 = Range([BB8], [BB8].End(xlDown))
Set rngmonth12 = Range([BG8], [BG8].End(xlDown))
zm1 = rngmonth1.Rows.Count
zm2 = rngmonth2.Rows.Count
zm3 = rngmonth3.Rows.Count
zm4 = rngmonth4.Rows.Count
zm5 = rngmonth5.Rows.Count
zm6 = rngmonth6.Rows.Count
zm7 = rngmonth7.Rows.Count
zm8 = rngmonth8.Rows.Count
zm9 = rngmonth9.Rows.Count
zm10 = rngmonth10.Rows.Count
zm11 = rngmonth11.Rows.Count
zm12 = rngmonth12.Rows.Count
arrmonth1 = rngmonth1
arrmonth2 = rngmonth2
arrmonth3 = rngmonth3
arrmonth4 = rngmonth4
arrmonth5 = rngmonth5
arrmonth6 = rngmonth6
arrmonth7 = rngmonth7
arrmonth8 = rngmonth8
arrmonth9 = rngmonth9
arrmonth10 = rngmonth10
arrmonth11 = rngmonth11
arrmonth12 = rngmonth12
Thanks,
RET79
This message was edited by RET79 on 2002-04-01 06:52