+ Reply to Thread
Results 1 to 6 of 6

printing from sheet X to sheet Y

  1. #1
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Question printing from sheet X to sheet Y

    Gday Guys,

    I just wanted some help with printing sheets.

    I have a worksheet "Print" in which the user selects from 2 drop down lists the sheet to print from, and in the other the sheet to print to.

    The worksheets Listed in these two lists are in date format. i.e. dd-mm-yyyy. and the worksheet names are always 7 days higher than the previous sheet.

    example
    sheets(1).Name = 01-01-2013
    sheets(2).Name = 08-01-2013
    ...
    Sheets(4).Name= 22-01-2013
    etc etc

    I wish for the user to be able to select the worksheet to start and the worksheet to finish the print.

    So from the example above if the user selects sheets(1) to sheets(4) then sheets(1) will print, sheets(2) will print, sheets(3) will print, and sheets(4) will print


    How do i do this such that it will work for what ever combination the user selects?

    Regards
    J
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: printing from sheet X to sheet Y

    perhaps i could use something along the lines of..
    Please Login or Register  to view this content.
    I need to change this as it crashes when it gets to the if statement
    Last edited by jordan2322; 10-01-2012 at 11:57 PM.

  3. #3
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: printing from sheet X to sheet Y

    it crashes becasue when the macro gets Sheets("Print").Range("H13").Value its setting the value in dd/mm/yyyy form not dd-mm-yyyy even though the cell value is dd-mm-yyyy. how do i force vba to get the cell value exactly as it is to compensate for this error?

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: printing from sheet X to sheet Y

    Hi jordan2322, try it
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: printing from sheet X to sheet Y

    thanks yet again nilem.

    One issue with the code tho, when it reads dtTo its reading the date as ##/##/####. It correctly reads the dtFrom as ##-##-####. Why is this?
    the macro will only print out the first worksheet because of this..

    regards
    jordan

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: printing from sheet X to sheet Y

    Unfortunately I can not explain. The code works correctly in my Russian version Excel.
    Try to play around with the format of cells E13 and H13

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1