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

I am using a loop to try and copy information in a vertical range to be
displayed in a horizontal range as the next values at the bottom of a list

so far i have:

Private Sub Insert_Click()

Dim x, y
x = 4
Do Until y = 45

If Sheets("sheet2").Cells(x, 45) = "" Then

Range(Cells(10, 6), Cells(19, 6)).Copy _
Destination:=Range(Sheets("sheet2").Cells(x, 45),
Sheets("sheet2").Cells(x, 54))

y = 45

End If
x = x + 1

Loop
End Sub


but this just copies the vertical range of values multiple times across the
specified copy range, not transposing it as i would like it to do.

any suggestions would be much appreciated

regards Patrick

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default Loop Problem

Patrick,

Try this (not tested):


Private Sub Insert_Click()

Dim x, y
x = 4
Do Until y = 45

If Sheets("sheet2").Cells(x, 45) = "" Then

Range(Cells(10, 6), Cells(19, 6)).Copy
Range(Sheets("sheet2").Cells(x, 45).PasteSpecial
Transpose:=True

y = 45

End If
x = x + 1

Loop
End Sub

Mark Lincoln


On Aug 30, 10:46 am, Patrick Bateman
wrote:
I am using a loop to try and copy information in a vertical range to be
displayed in a horizontal range as the next values at the bottom of a list

so far i have:

Private Sub Insert_Click()

Dim x, y
x = 4
Do Until y = 45

If Sheets("sheet2").Cells(x, 45) = "" Then

Range(Cells(10, 6), Cells(19, 6)).Copy _
Destination:=Range(Sheets("sheet2").Cells(x, 45),
Sheets("sheet2").Cells(x, 54))

y = 45

End If
x = x + 1

Loop
End Sub

but this just copies the vertical range of values multiple times across the
specified copy range, not transposing it as i would like it to do.

any suggestions would be much appreciated

regards Patrick



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
For Loop Problem Brian Matlack[_75_] Excel Programming 2 May 15th 06 09:59 PM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
Problem with Do Loop and If aehan Excel Programming 7 April 8th 05 01:01 AM
Loop Problem John[_88_] Excel Programming 3 July 10th 04 10:55 AM


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