View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Myrna Larson[_2_] Myrna Larson[_2_] is offline
external usenet poster
 
Posts: 124
Default Splitting a Procedure

Typo, Tom. Should be

For i = 0 To 6

not 7. But I prefer Lbound and UBound, to avoid errors if there's an Option Base 1 statement at
the top of the module.

On Tue, 26 Aug 2003 11:33:53 -0400, "Tom Ogilvy" wrote:

Private Sub Up1_Click()

Dim i as long, idex as long

Dim rngSource as Range, rngDest as Range

Dim sName as String

Dim varr as variant, varr1 as variant
idex = LB1.ListIndex+1

SName = "QA"&idex
Range("C5").Value = Worksheets(sName).Range("B4").Value
Range("C6").Value = Worksheets(sName).Range("E4").Value
varr = Array(13,14,31,49,78,96,114)

varr1 = Array(6,9,11,12,13,14,16)

for i = 0 to 7

set rngSource = worksheets(sName).Cells(varr1(i),4).Resize(1,12)

set rngDest = Cells(varr(i),3).Resize(1,12)

rngDest.Value = rngSource.value

Next

End Sub



Should be a little more manageable.