+ Reply to Thread
Results 1 to 3 of 3

Setting a print area in vba

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    Derbyshire
    MS-Off Ver
    Excel 2003
    Posts
    7

    Setting a print area in vba

    Hi.

    Hope someone can help me with a problem?

    I would like to write a VBA print button which selects all entered data from Column A1 to ED (Static), and the last Row with "1" in Column ED (the last row starts at ED15, and goes all the way down to ED515, and depending on the number of items I'm pricing for, can either be A1 to ED15, or A1 to ED515)

    At present in ED I've got a formula which is =IF(ISTEXT(A15),1,0)), but when I use xlUp, it selects the last row with the formula, not the "1", or "0".

    Is it possible to use VBA to "ignore" the formula, or instead of 1, can I use " "?

    I'm sure the answer is simple, but I'm not an expert in VBA.

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Setting a print area in vba

    Use the VBA Find method, like this:
    Please Login or Register  to view this content.
    I used the Macro Recorder to generate the Find call and edited the code. The printCells range gives you the print area range, which you could use as an argument to macro recorder-generated code whilst setting the print area.
    Post responsibly. Search for excelforum.com

  3. #3
    Registered User
    Join Date
    06-21-2012
    Location
    Derbyshire
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Setting a print area in vba

    Hi Chippy,

    Thanks for getting back to me!

    I'm just tying your suggestion out on my spreadsheet, so far it works fine (I've just got to get it to set the Print Area!)

    I really appreciate the help.

+ 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