+ Reply to Thread
Results 1 to 3 of 3

Setting Print area with VBA code on active sheet - Can't get my code to work

  1. #1
    Registered User
    Join Date
    12-26-2016
    Location
    London, England
    MS-Off Ver
    365
    Posts
    79

    Setting Print area with VBA code on active sheet - Can't get my code to work

    Hi - I have some code that I hoped would set the Print area of the active sheet to a range of cells and then Page Set Up to print on page 1 of 1 centred both Horizontally and Vertically.

    Got a bit lost - any help please?

    Here is my attempt at the code !

    Please Login or Register  to view this content.
    Thanks in anticipation
    Hans302

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Setting Print area with VBA code on active sheet - Can't get my code to work

    You need to say ".Address" to set the print area or "$F$5:$S$69"

    For example:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-26-2016
    Location
    London, England
    MS-Off Ver
    365
    Posts
    79

    Re: Setting Print area with VBA code on active sheet - Can't get my code to work

    Many thanks !!

+ 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. VBA code to have print button and print the required area in sheet.
    By Ishwarind in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-09-2016, 03:54 AM
  2. [SOLVED] Code to execute multiple tasks such as deleting rows, inserting sums, setting print area
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-03-2013, 04:18 PM
  3. Setting print area with code
    By rmunsun1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2011, 06:55 AM
  4. Print Area:What would be the code for setting the print area
    By wammer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2005, 02:05 AM
  5. Changing code that set's print area...to active sheet only
    By KimberlyC in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-10-2005, 06:05 PM
  6. Setting more parameters with Print area code
    By KimberlyC in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-08-2005, 12:05 PM
  7. Help with code setting print area
    By KimberlyC in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-30-2005, 08:05 PM

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