+ Reply to Thread
Results 1 to 6 of 6

Printing a Dynamic Range with VBA coding

  1. #1
    Forum Contributor
    Join Date
    11-25-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    2010
    Posts
    146

    Printing a Dynamic Range with VBA coding

    I am trying to set up a dynamic print range to print a sheet in a work book that is populated from another sheet in the same workbook. I seem to be having trouble. I set up a named range in Name Manager called lateral as follows:

    =OFFSET('Slide Sheet Print Lateral'!$A$27, 0, 0, COUNTA('Slide Sheet Print Lateral'!$A:$A), COUNTA('Slide Sheet Print Lateral'!$1:$1))

    I can't seem to make that work for some reason.
    I am stuck trying to write the VBA code ( I know nothing about VBA) I have this that I recorded, I have the sheet hidden that I want to print it unhides it and then rehides it.

    Please Login or Register  to view this content.
    Basically I want it to print from A through to N if there is a value in Column A if there is no value in A then print up to the line that is blank

    I get an error "Run Time Error '1004'" on
    sorry for all the #REF errors in attachement, had to delete a bunch of pages so it was small enough to upload

    Can anyone help?




    Moderator's Note: Welcome to the forum, don't forget to put code tags on codes, Select the code then Hit the "#" sign. Thank you.
    Attached Files Attached Files
    Last edited by vlady; 11-25-2012 at 08:43 PM. Reason: code tags

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Printing a Dynamic Range with VBA coding

    Hi groundin,

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    11-25-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    2010
    Posts
    146

    Re: Printing a Dynamic Range with VBA coding

    i tried it, seemed to work fine, should i insert it into my existing code?

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Printing a Dynamic Range with VBA coding

    You can put it in your module then call it from your existing code or you could incorporate it:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-25-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    2010
    Posts
    146

    Re: Printing a Dynamic Range with VBA coding

    That's kick ***, works perfect!
    I really appreciate your help!

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Printing a Dynamic Range with VBA coding

    You're welcome!

+ 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