Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Script out of range
I am trying to correct a "script out of range" error in a macro, but I'm not
sure what it refers to. Here's a copy of the macro, if anyone could tell me what I'm looking for that would be great. Thanks, J Sub MoveRow2Data() Dim X As Long, Z As Long Dim LastColumn As Long Const StartCol As Long = 9 Const GroupCount As Long = 5 Const MoveToColumn As Long = 4 Const DataRow As Long = 2 With Worksheets(TrustDepositCSVfile) LastColumn = .Cells(DataRow, .Columns.Count).End(xlToLeft).Column For X = StartCol To LastColumn Step 5 For Z = 0 To GroupCount - 1 ..Cells(DataRow, X + Z).Copy _ Destination:=.Cells(X - 9 + DataRow + Z, MoveToColumn) Next Next ..Cells(DataRow, StartCol).Resize(1, LastColumn - _ StartCol + 1).ClearContents End With End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Range Syntax for Script | Excel Programming | |||
Adjusting the range of a script | Excel Programming | |||
VB Script to insert row and calculate a range | Excel Programming | |||
sub script out of range problem | Excel Programming | |||
Script out of range error | Excel Programming |