Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Array Question

Dear All,

I have 10 rows of single columned data in identical places on three
different worksheets, in the same workbook. (ie. I have 30 cells of data -
10 cells by 3 sheets).

I wish to loop through both the 3 worksheets and the 10 celled range and
collect their data, then in place this data in a single row on a fourth
worksheet.

For some reason (basically not yet skilled enough!!) I can only seem to loop
through the 3 workbooks and only collect the data from the last sheet (ie.
collect only the last 10 cells).

My array needs to accommodate 30 elements, I'm just getting the last 10....

The first 3 sheets are basically regional data, the 4th sheet a data summary
page.

I unfortunately don't have the code I used with me to show you (it is at
work), but does anybody have any suggestions?

Kindest Regards,

andy m


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Array Question

Hello!

Hard to say without seeing the code.

But a very quick guess:

I assume you use 2 loops. The outer loop goes through the 3 sheets. Th
inner loop goes through the 10 cells for each sheet.
Maybe you are resetting the variable that points to the target ro
inside loop 1. That would cause the values from sheet one to b
overwritten by the values from sheet two, and these values again ge
overwritten by the values from sheet three. That would match you
description ....

Ro

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Array Question

Sub Button1_Click()

i = 1
For Each sht In Worksheets
If sht.Name < "Sheet4" Then
For Each cell In sht.Range("A1:A10")
ActiveSheet.Cells(1, i) = cell
i = i + 1
Next
End If
Next

End Sub

- Manges

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Array Question

Sub Button1_Click()

i = 1
For Each sht In Worksheets
If sht.Name < "Sheet4" Then
For Each cell In sht.Range("A1:A10")
ActiveSheet.Cells(1, i) = cell
i = i + 1
Next
End If
Next

End Sub


this considers that you have data in 3 sheets and you have a total of
sheets only. all data is put in sheet4.

- Manges

--
Message posted from http://www.ExcelForum.com

Reply
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
Array Question Renee Excel Worksheet Functions 0 June 29th 05 07:10 PM
Array question mickiedevries[_9_] Excel Programming 3 August 24th 04 06:58 PM
Array question Steve Farrar Excel Programming 2 February 18th 04 04:21 PM
Array question Stuart[_5_] Excel Programming 1 August 6th 03 04:13 AM
Is this an array question? Stuart[_5_] Excel Programming 0 August 5th 03 08:53 PM


All times are GMT +1. The time now is 06:27 AM.

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"