LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Simple Loop question

Hmm, I suppose the other responders to your OP are finding your requirement
difficult to interpret. You get what you ask for.

Good luck

Cheers

--

Regards,
Nigel




"fedude" wrote in message
...
Thanks Nigel. This got me off to a good start. Unfortunately the rows
and
column don't match up for a nice "transpose".

"Nigel" wrote:

Sub CopyCalc()
Dim sh1 As Worksheet, sh2 As Worksheet
Dim r1 As Range, c1 As Range, c As Long

Set sh1 = Worksheets("Sheet1")
Set sh2 = Worksheets("Sheet2")

' set top left cell for range on sheet1 and sheet2
Set r1 = sh1.Range("A1")
Set c1 = sh2.Range("A1")

For c = r1.Row - 1 To r1.Row + 23
Range(r1.Offset(c, 0), r1.Offset(c, 4)).Copy
c1.PasteSpecial Transpose:=True

'code to print you output

Next
End Sub

--

Regards,
Nigel




"fedude" wrote in message
...
I have 2 sheets in a workbook. Sheet1 contains 25 rows of data.
Sheet2
contains a column of 5 cells that are the basis for a large calculation
within that sheet. Today I'm manually loading up the 5 cells and then
running a macro to print out the results.

I want a routine that loops through the 25 rows of Sheet1 and for each
row,
copies 5 of the cells (in that row) into the appropriate cells in
Sheet2
and
then run the print macro. I'd like to run this routine from Sheet2 if
that
matters.

The data in Sheet1 is in rows and the destination of the values in
Sheet2
is
in a column



 
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
simple nested loop question fedude Excel Programming 8 March 2nd 08 05:04 PM
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
simple loop question Rob Excel Programming 5 September 13th 05 08:10 PM
Simple question on For...Next loop Alex Excel Programming 1 July 26th 05 03:30 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM


All times are GMT +1. The time now is 09:20 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"