+ Reply to Thread
Results 1 to 5 of 5

Printing using vba

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Printing using vba

    I have written the following code to enable the printing of a selected area of a large worksheet
    Please Login or Register  to view this content.
    It does not work.
    The computer seems to go into a loop at the line .PrintArea = Range(RName).Address
    The only way I can get going again is by restarting.
    Where have I gone wrong?
    John

  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    935

    Re: Printing using vba

    You haven't given enough information. It would be interesting for you to know what information you are passing to the variable RName.
    Enter a stop (F9) on the first line of code in that macro. Launch your print and when the macro stops in Debug on that line see if the contents of RName are consistent with the print area.

  3. #3
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Re: Printing using vba

    rollis13,
    Thank you for your interest. I put in a stop as you suggested and found RName to have as its value the name of the range I wished to print. When I went past the stop the printing carried on as I wished it to. It seems likely that the fault was in the printer not the code. I am sorry that I wasted your time.
    John

  4. #4
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    935

    Re: Printing using vba

    Why do you say 'wasted your time', I'm glad having been of some help.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,948

    Re: Printing using vba

    Try either of these approaches:

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Page Breaks are Printing on my document - how can I suppress printing them?
    By pongmeister in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-18-2018, 11:40 AM
  2. [SOLVED] Dynamic printing area for logic and economic printing
    By vendam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2018, 01:43 AM
  3. Replies: 1
    Last Post: 06-11-2014, 09:23 AM
  4. Replies: 0
    Last Post: 02-27-2014, 01:31 PM
  5. Replies: 0
    Last Post: 07-18-2012, 03:57 AM
  6. Replies: 3
    Last Post: 07-16-2012, 03:24 AM
  7. Disabling Printing ability of a sheet unless printing from a macro
    By cadamhill in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2012, 04:41 AM

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