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

I'm hoping someone here can help with this. I'm trying to copy rows from a
database sheet to a printable form sheet one row at a time.

My database sheet will have any number of rows on a given day that I would
like to copy to row 38 on a printable form sheet. This row is linked to fill
in the form before printing.

The problem is that I would like to copy the rows from the database sheet to
row 38 on the form sheet one row at a time, stopping at the last row with
data.

Basically just a copy,print,copy,print,copy,print,etc. to the last row with
data.

I can't use a range because I will have a different number of rows daily.

I hope this makes sense.

TIA
qwerty


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default copying rows

one way:

Public Sub CopyAndPrint()
Dim cell As Range
Dim destRange As Range
Set destRange = Sheets("PrintForm").Range("A38")
With Sheets("Database")
For Each cell In .Range("A1:A" & _
Range("A" & Rows.Count).End(xlUp).Row)
cell.EntireRow.Copy destRange
destRange.Parent.PrintOut
Next cell
End With
End Sub


In article ,
"Qwerty" wrote:

I'm hoping someone here can help with this. I'm trying to copy rows from a
database sheet to a printable form sheet one row at a time.

My database sheet will have any number of rows on a given day that I would
like to copy to row 38 on a printable form sheet. This row is linked to fill
in the form before printing.

The problem is that I would like to copy the rows from the database sheet to
row 38 on the form sheet one row at a time, stopping at the last row with
data.

Basically just a copy,print,copy,print,copy,print,etc. to the last row with
data.

I can't use a range because I will have a different number of rows daily.

I hope this makes sense.

TIA
qwerty


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default copying rows

WORKS GREAT! THANX

"J.E. McGimpsey" wrote in message
...
one way:

Public Sub CopyAndPrint()
Dim cell As Range
Dim destRange As Range
Set destRange = Sheets("PrintForm").Range("A38")
With Sheets("Database")
For Each cell In .Range("A1:A" & _
Range("A" & Rows.Count).End(xlUp).Row)
cell.EntireRow.Copy destRange
destRange.Parent.PrintOut
Next cell
End With
End Sub


In article ,
"Qwerty" wrote:

I'm hoping someone here can help with this. I'm trying to copy rows from

a
database sheet to a printable form sheet one row at a time.

My database sheet will have any number of rows on a given day that I

would
like to copy to row 38 on a printable form sheet. This row is linked to

fill
in the form before printing.

The problem is that I would like to copy the rows from the database

sheet to
row 38 on the form sheet one row at a time, stopping at the last row

with
data.

Basically just a copy,print,copy,print,copy,print,etc. to the last row

with
data.

I can't use a range because I will have a different number of rows

daily.

I hope this makes sense.

TIA
qwerty




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default copying rows

the following assumes that your data is held on a sheet called "datasheet"
and begins in cell "A1" and is continuous in column "A" until the last row
with data


Sheets("datasheet").Select
Range(Range("A1"), Range("A1").End(xlDown)).Select
For Each rng In Selection
Rows(rng.Row).Copy
Sheets("printsheet").Range("A38").PasteSpecial (xlPasteAll)
'your print out code here
Next rng


Qwerty wrote in message
...
I'm hoping someone here can help with this. I'm trying to copy rows from a
database sheet to a printable form sheet one row at a time.

My database sheet will have any number of rows on a given day that I would
like to copy to row 38 on a printable form sheet. This row is linked to

fill
in the form before printing.

The problem is that I would like to copy the rows from the database sheet

to
row 38 on the form sheet one row at a time, stopping at the last row with
data.

Basically just a copy,print,copy,print,copy,print,etc. to the last row

with
data.

I can't use a range because I will have a different number of rows daily.

I hope this makes sense.

TIA
qwerty




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default copying rows

Thanks. Does what I need.

"Stuart" wrote in message
...
the following assumes that your data is held on a sheet called "datasheet"
and begins in cell "A1" and is continuous in column "A" until the last row
with data


Sheets("datasheet").Select
Range(Range("A1"), Range("A1").End(xlDown)).Select
For Each rng In Selection
Rows(rng.Row).Copy
Sheets("printsheet").Range("A38").PasteSpecial (xlPasteAll)
'your print out code here
Next rng


Qwerty wrote in message
...
I'm hoping someone here can help with this. I'm trying to copy rows from

a
database sheet to a printable form sheet one row at a time.

My database sheet will have any number of rows on a given day that I

would
like to copy to row 38 on a printable form sheet. This row is linked to

fill
in the form before printing.

The problem is that I would like to copy the rows from the database

sheet
to
row 38 on the form sheet one row at a time, stopping at the last row

with
data.

Basically just a copy,print,copy,print,copy,print,etc. to the last row

with
data.

I can't use a range because I will have a different number of rows

daily.

I hope this makes sense.

TIA
qwerty








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
Copying & Inserting Rows w/o Affecting other Rows Etc. LRay67 Excel Worksheet Functions 1 October 22nd 08 02:10 AM
Copying rows from one sheet to another.... Buyone Excel Worksheet Functions 1 June 20th 07 10:56 PM
Copying multiple rows to other worksheets (but amount of rows varies) - How? David Smithz Excel Discussion (Misc queries) 1 June 18th 06 04:31 PM
Copying Rows Dthmtlgod New Users to Excel 3 November 4th 05 05:50 AM
Copying Rows when hiding other rows Neutron1871 Excel Worksheet Functions 2 November 3rd 04 11:38 PM


All times are GMT +1. The time now is 11:46 PM.

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"