Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to move to next row?
I have a macro that copies/pastes data from a row into a form then prints the
form. How do get this to repeat for all of the rows in the table? TIA |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to move to next row?
Dim cell as Range
for each cell in Range("Table").columns(1).Cells cell.Resize(1,Range("Table").columns.count).copy _ Destination:=worksheets("Form").Range("A3") Worksheets("Form").Printout Next -- Regards, Tom Ogilvy "Rick Billingsley" <Rick wrote in message ... I have a macro that copies/pastes data from a row into a form then prints the form. How do get this to repeat for all of the rows in the table? TIA |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to move to next row?
Tom,
Thanks for the response. I am no programmer so I'm going to need a little more help. Here is a section of the macro. This repeats for about 10 different data elements that are not contiguous within the row. Sub Populate2005Data() ' ' Populate2005Data Macro ' Macro recorded 11/16/2005 by Rick Billingsley ' ' Sheets("2005 elections").Select Range("A18").Select Selection.Copy Sheets("Side One").Select ActiveSheet.Paste Sheets("2005 elections").Select Range("B18").Select Application.CutCopyMode = False Selection.Copy Sheets("Side One").Select Range("G6:I6").Select ActiveSheet.Paste End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to move to next row?
Sub Populate2005Data()
' ' Populate2005Data Macro ' Macro recorded 11/16/2005 by Rick Billingsley ' ' Dim sh as Worksheet, sh1 as Worksheet Dim rw as Long for rw = 2 to 25 Set sh = Worksheets("2005 Elections") set sh1 = Worksheets("Side One") Sh.Range("A" & rw).Copy sh.Range("A1") sh.Range("B" & rw).Copy sh1.Range("G6:I6") sh.Range("L" & rw).Copy sh1.Range("E14:H14") sh.Range("M" & rw).Copy sh1.Range("E15:H15") sh.Range("N" & rw).Copy sh1.Range("E16:H16") sh.Range("O" & rw).Copy sh1.Range("E17:H17") sh.Range("Q" & rw).Copy sh1.Range("K23").PasteSpecial Paste:=xlPasteValues sh.Range("R" & rw).Copy sh1.Range("K24").PasteSpecial Paste:=xlPasteValues Worksheets("Side One").PrintOut _ Copies:=1, Collate:=True Next rw End Sub Change for rw = 2 to 25 to reflect the rows you want printed. -- Regards, Tom Ogilvy "Rick Billingsley" wrote in message ... Tom, Thanks for the response. I am no programmer so I'm going to need a little more help. Here is a section of the macro. This repeats for about 10 different data elements that are not contiguous within the row. Sub Populate2005Data() ' ' Populate2005Data Macro ' Macro recorded 11/16/2005 by Rick Billingsley ' ' Sheets("2005 elections").Select Range("A18").Select Selection.Copy Sheets("Side One").Select ActiveSheet.Paste Sheets("2005 elections").Select Range("B18").Select Application.CutCopyMode = False Selection.Copy Sheets("Side One").Select Range("G6:I6").Select ActiveSheet.Paste End Sub |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to move to next row?
Thanks a million!! That works great!
"Tom Ogilvy" wrote: Sub Populate2005Data() ' ' Populate2005Data Macro ' Macro recorded 11/16/2005 by Rick Billingsley ' ' Dim sh as Worksheet, sh1 as Worksheet Dim rw as Long for rw = 2 to 25 Set sh = Worksheets("2005 Elections") set sh1 = Worksheets("Side One") Sh.Range("A" & rw).Copy sh.Range("A1") sh.Range("B" & rw).Copy sh1.Range("G6:I6") sh.Range("L" & rw).Copy sh1.Range("E14:H14") sh.Range("M" & rw).Copy sh1.Range("E15:H15") sh.Range("N" & rw).Copy sh1.Range("E16:H16") sh.Range("O" & rw).Copy sh1.Range("E17:H17") sh.Range("Q" & rw).Copy sh1.Range("K23").PasteSpecial Paste:=xlPasteValues sh.Range("R" & rw).Copy sh1.Range("K24").PasteSpecial Paste:=xlPasteValues Worksheets("Side One").PrintOut _ Copies:=1, Collate:=True Next rw End Sub Change for rw = 2 to 25 to reflect the rows you want printed. -- Regards, Tom Ogilvy "Rick Billingsley" wrote in message ... Tom, Thanks for the response. I am no programmer so I'm going to need a little more help. Here is a section of the macro. This repeats for about 10 different data elements that are not contiguous within the row. Sub Populate2005Data() ' ' Populate2005Data Macro ' Macro recorded 11/16/2005 by Rick Billingsley ' ' Sheets("2005 elections").Select Range("A18").Select Selection.Copy Sheets("Side One").Select ActiveSheet.Paste Sheets("2005 elections").Select Range("B18").Select Application.CutCopyMode = False Selection.Copy Sheets("Side One").Select Range("G6:I6").Select ActiveSheet.Paste End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel arrows don't move black box but move the window | Excel Discussion (Misc queries) | |||
Can I Move replace instead of Move copy | Excel Discussion (Misc queries) | |||
excel-how to get the spreadsheet to move as I move the scroll tab | Excel Discussion (Misc queries) | |||
How do I stop making the spreadsht move when I move up/dwn/lt/rt? | Excel Worksheet Functions | |||
When I move scroll bar in excell the contents do not move with it | Excel Discussion (Misc queries) |