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

OK, I get the hint. Here is what I have. It seems overly complicated, but
unfortunately, the rows don't match up for a nice "transpose". I'd
appreciate any help in simplifying the COPY:

--------------------------------------------------------------------------
'--------------------------------------------------
' Routine to print off all 32 double-sided
' scorecards in a single pdf file
'--------------------------------------------------
Sub PrintCards()
Dim sh1 As Worksheet, sh2 As Worksheet
Dim RowCount As Integer

Set sh1 = Worksheets("Sheet2") 'source
Set sh2 = Worksheets("Sheet1") 'destination

For RowCount = 4 To 40
If sh1.Range("AS" & RowCount) < "" Then
'copy the names
sh1.Range("AS" & RowCount).Copy _
Destination:=sh2.Range("DG71")
sh1.Range("AT" & RowCount).Copy _
Destination:=sh2.Range("DH71")
sh1.Range("AV" & RowCount).Copy _
Destination:=sh2.Range("DG72")
sh1.Range("AW" & RowCount).Copy _
Destination:=sh2.Range("DH72")
sh1.Range("AY" & RowCount).Copy _
Destination:=sh2.Range("DG73")
sh1.Range("AZ" & RowCount).Copy _
Destination:=sh2.Range("DH73")
sh1.Range("BB" & RowCount).Copy _
Destination:=sh2.Range("DG74")
sh1.Range("BC" & RowCount).Copy _
Destination:=sh2.Range("DH74")
'copy the handicaps
sh1.Range("AU" & RowCount).Copy _
Destination:=sh2.Range("DK71")
sh1.Range("AX" & RowCount).Copy _
Destination:=sh2.Range("DK72")
sh1.Range("BA" & RowCount).Copy _
Destination:=sh2.Range("DK73")
sh1.Range("BD" & RowCount).Copy _
Destination:=sh2.Range("DK74")
'course
sh1.Range("BE" & RowCount).Copy _
Destination:=sh2.Range("DE75")
'starting hole
sh1.Range("BF" & RowCount).Copy _
Destination:=sh2.Range("DE76")
'starting order
sh1.Range("BG" & RowCount).Copy _
Destination:=sh2.Range("DE77")
'fileame
sh1.Range("BI" & RowCount).Copy _
Destination:=sh2.Range("DE78")

'code to print scoresheet

End If

Next

End Sub
--------------------------------------------------------------


"Don Guillett" wrote:

The macro recorder is your friend. Show us your efforts for comments


 
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:55 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"