Consulting

Results 1 to 4 of 4

Thread: Multi Time sheet production

  1. #1
    VBAX Regular
    Joined
    Feb 2010
    Location
    uk
    Posts
    15
    Location

    Multi Time sheet production

    Chaps can anyone of you VBA kings please help me out and take a look at the spreadsheet , it has a small macro and button that is not working , once the button in the tsheet is pushed it is then meant to print a time sheet with a different name from the data sheet, but what is happening instead is that the dat sheet is bing printed and not the time , 34 for times (34 pages in the data sheet)
    If anyone could help I would be grateful
    Regards,
    Lee

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub Macro1()
    With Sheets("Data")

    .Range("Data").Copy .Range("A501")

    Do

    .Range("A501..E501").Copy .Range("A499")
    Worksheets("TSHEET").PrintOut Copies:=1
    .Range("A501").EntireRow.Delete
    Loop Until .Range("A501") = ("")
    End With
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Feb 2010
    Location
    uk
    Posts
    15
    Location
    Thanks for that pal
    what was up with original as it did work but stooped for some reason
    Cheers,

    Lee

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    This line is printing out the active sheet
    [VBA]
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    [/VBA]
    XLD's code is specific as to the sheet to print.
    [VBA]
    Worksheets("TSHEET").PrintOut Copies:=1

    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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