Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ims ims is offline
external usenet poster
 
Posts: 4
Default print with data

Dear all,

I've a worksheet

A B C D
Date 3.1.03 David
Name 4.1.03 Tom
6.1.03 Mary
8.1.03 Roy

The printing area is A1:B2
B1=C1 and B2=D1 for the first printout
B1=C2 and B2=D2 for the second printout
and so on.....

How can I do this?

thanks

ims



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default print with data

This procedure should help:

Sub Output()
Dim rw As Long
'set row to first row of data
rw = 1
Do Until Cells(rw, "C") = ""
Range("B1").Calue = Cells(rw, "C")
Range("B2").Calue = Cells(rw, "D")
ActiveSheet.Print
rw = rw + 1 ' next row
Loop
End Sub

Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
Dear all,

I've a worksheet

A B

C D
Date 3.1.03 David
Name 4.1.03 Tom
6.1.03 Mary
8.1.03 Roy

The printing area is A1:B2
B1=C1 and B2=D1 for the first printout
B1=C2 and B2=D2 for the second printout
and so on.....

How can I do this?

thanks

ims



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default print with data

This macro should do the trick

Sub PrintData()
Dim Counter As Integer

Application.ScreenUpdating = False

ActiveSheet.PageSetup.PrintArea = "$A$1:$B$2"

Do
Range("B1") = Range("C1").Offset(Counter, 0)
Range("B2") = Range("C1").Offset(Counter, 1)
'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Counter = Counter + 1
Loop Until ActiveCell.Offset(X, 0) = ""

Application.ScreenUpdating = True

End Sub


DavidP

On Mon, 10 Nov 2003 15:31:39 +0800, "ims"
wrote:

Dear all,

I've a worksheet

A B C D
Date 3.1.03 David
Name 4.1.03 Tom
6.1.03 Mary
8.1.03 Roy

The printing area is A1:B2
B1=C1 and B2=D1 for the first printout
B1=C2 and B2=D2 for the second printout
and so on.....

How can I do this?

thanks

ims



  #4   Report Post  
Posted to microsoft.public.excel.programming
ims ims is offline
external usenet poster
 
Posts: 4
Default print with data

Dear Patrick,

line ActiveSheet.Print got error when executing, dunno why

ims



"Patrick Molloy"
...
This procedure should help:

Sub Output()
Dim rw As Long
'set row to first row of data
rw = 1
Do Until Cells(rw, "C") = ""
Range("B1").Calue = Cells(rw, "C")
Range("B2").Calue = Cells(rw, "D")
ActiveSheet.Print
rw = rw + 1 ' next row
Loop
End Sub

Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
Dear all,

I've a worksheet

A B

C D
Date 3.1.03 David
Name 4.1.03 Tom
6.1.03 Mary
8.1.03 Roy

The printing area is A1:B2
B1=C1 and B2=D1 for the first printout
B1=C2 and B2=D2 for the second printout
and so on.....

How can I do this?

thanks

ims



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
ims ims is offline
external usenet poster
 
Posts: 4
Default print with data

It works, thanks a lot.

ims
'

"DavidP"
...
This macro should do the trick

Sub PrintData()
Dim Counter As Integer

Application.ScreenUpdating = False

ActiveSheet.PageSetup.PrintArea = "$A$1:$B$2"

Do
Range("B1") = Range("C1").Offset(Counter, 0)
Range("B2") = Range("C1").Offset(Counter, 1)
'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Counter = Counter + 1
Loop Until ActiveCell.Offset(X, 0) = ""

Application.ScreenUpdating = True

End Sub


DavidP

On Mon, 10 Nov 2003 15:31:39 +0800, "ims"
wrote:

Dear all,

I've a worksheet

A B C D
Date 3.1.03 David
Name 4.1.03 Tom
6.1.03 Mary
8.1.03 Roy

The printing area is A1:B2
B1=C1 and B2=D1 for the first printout
B1=C2 and B2=D2 for the second printout
and so on.....

How can I do this?

thanks

ims





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
can't print data labels - on screen but don't print out Linda Charts and Charting in Excel 1 June 27th 09 07:11 PM
print data angie Excel Worksheet Functions 0 May 9th 06 02:20 PM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
how do I print data in a spreadsheet data base to a mailing lable. Kevin Jamieson Excel Discussion (Misc queries) 0 March 15th 05 10:57 PM
how do I print data in a spreadsheet data base to a mailing lable. Database Excel Discussion (Misc queries) 0 March 15th 05 10:57 PM


All times are GMT +1. The time now is 06:01 AM.

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"