PDA

View Full Version : Solved: How to print each worksheet individually from master worksheet



tlchan
10-17-2010, 09:16 AM
Hi There,

I have a worksheet("Cust_stmt") as master statement for input of variable customer data from worksheet("custdata") using Vlookup function using VBA. Whenever range ("I9") changed the value.(customer's account No) will trigger the code to fill up the respective data for individual statement.

What I wish to achieve as to how should I print out each individual account statement via VBA instead of input manually one by one for account No in order to print the statement.


Any body can help ? :friends:

sample file attached

p45cal
10-17-2010, 10:17 AM
try:
Sub PrintSheets()
Dim Nos As Range
With Sheets("CustData")
Set Nos = Range(.Range("A3"), .Cells(.Rows.Count, 1).End(xlUp))
End With
For Each cll In Nos.Cells
If cll.Value <> "" Then
Sheets("Cust_stmt").Range("I9").Value = cll.Value
Sheets("Cust_stmt").PrintPreview
End If
Next cll
End Sub

tlchan
10-19-2010, 04:25 PM
Thanks p45cal. You are brilliant ! It works as what I expected.