LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
j j is offline
external usenet poster
 
Posts: 128
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Range Syntax for Script [email protected] Excel Programming 3 June 21st 07 06:34 PM
Adjusting the range of a script jsd219 Excel Programming 0 October 31st 06 07:56 PM
VB Script to insert row and calculate a range rlee1999 Excel Programming 3 October 26th 06 01:37 PM
sub script out of range problem AmyTaylor[_20_] Excel Programming 5 July 27th 05 12:17 AM
Script out of range error [email protected] Excel Programming 5 May 24th 05 09:37 PM


All times are GMT +1. The time now is 11:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"