LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Copy sets of ranges

I need to copy different ranges of data to different
Worksheets. The data will always be in ranges C1:I?, the
next range will be J1:I?, so on. The # of ranges to copy
varies. Cell B2 shows how many ranges must be copied.
Here's what i have so far.

Dim lngLastRow As String
Dim shtActive As Worksheet
Dim myStartColumn, myEndColumn As String
lngLastRow = myDataSheet.UsedRange.Rows.Count
myStartColumn = 3
myEndColumn = myStartColumn + 7

For i = 1 To Range("b2").Value
Range("R[1]C[" & myStartColumn & "]:R[" & lngLastRow & "]C
[" & myEndColumn & "]").Select
Selection.Copy
Sheets("Item" & i & "").Select
Range("C1").Select
ActiveSheet.Paste

I'm gettin a :Run time error '1004' : Method 'Range' of
object'_Global'failed" error.

Please help.

 
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
How can I copy big ranges of cells without drag or copy/paste? Ricardo Julio Excel Discussion (Misc queries) 3 March 23rd 10 02:38 PM
how do i "link" two sets of named ranges des-sa[_2_] Excel Discussion (Misc queries) 2 February 10th 09 11:08 AM
how copy formula that contains ranges so ranges do not overlap Patty Excel Worksheet Functions 1 November 20th 08 04:15 PM
Excel graph 3 sets of data. 2 sets as lines 1 as column? AndyN Charts and Charting in Excel 2 July 11th 08 01:18 PM
countif with two sets of non consectutive ranges at the same time Gover Excel Worksheet Functions 8 September 15th 07 06:13 AM


All times are GMT +1. The time now is 11:13 AM.

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

About Us

"It's about Microsoft Excel"