Consulting

Results 1 to 5 of 5

Thread: Print Preview

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Print Preview

    I want to test my print routine because I am fine tuning it but do not want to print the report every time. I have tried to use print preview but so far no luck. Can anyone help from the code below?


    Public Sub PrintMtvGroupList() LastRow = Range("A65536").End(xlUp).Row Row = 1 Range("C1").Value = "Group Name" Range("D1").Value = "Bill Rep" Range("E1").Value = "Extension" Range("F1").Value = "Group Number" Range("G1").Value = "Back Up" For i = 1 To LastRow Step 6 Range("C" & Row).Value = Range("B" & i).Text Range("D" & Row).Value = Range("B" & i + 1).Text Range("E" & Row).Value = Range("B" & i + 2).Text Range("F" & Row).Value = Range("B" & i + 3).Text Range("G" & Row).Value = Range("B" & i + 4).Text Row = Row + 1 Next i Columns("C:G").PrintOut Columns("C:G").Clear End Sub
    Last edited by Killian; 04-21-2005 at 07:10 AM. Reason: Took out the super-wide code :)
    Peace of mind is found in some of the strangest places.

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    The PrintPreview method applies to ranges (among other things) so can be used with your columns

    Columns("C:G").PrintPreview
    K :-)

  3. #3
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    I tried that but it does not stop there. Comes on for a brief second then disappears

    Got it to work!! Thanks
    Peace of mind is found in some of the strangest places.

  4. #4
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    What did you change that made it work?

  5. #5
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Commented out the line right after that wher it clears the contents.


    Stupid error.
    Peace of mind is found in some of the strangest places.

Posting Permissions

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