Consulting

Results 1 to 3 of 3

Thread: Solved: How to print each worksheet individually from master worksheet

  1. #1
    VBAX Contributor
    Joined
    Sep 2007
    Posts
    119
    Location

    Solved: How to print each worksheet individually from master worksheet

    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 ?

    sample file attached

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    try:
    [VBA]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
    [/VBA]
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Contributor
    Joined
    Sep 2007
    Posts
    119
    Location
    Thanks p45cal. You are brilliant ! It works as what I expected.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •