+ Reply to Thread
Results 1 to 9 of 9

Dynamic Range to select only visible columns

  1. #1
    Registered User
    Join Date
    12-11-2013
    Location
    auckland
    MS-Off Ver
    Excel 2010
    Posts
    56

    Dynamic Range to select only visible columns

    I need a macro to start at cell A11 and select across 10 columns and down to the Lastrow (last row with any data).

    There are hidden columns after column D so it CANNOT have any columns hardcoded except for column A.

    This selection then needs to be set as a single print area to print out on 1 page. I have already set Rows 1-10 as a title area to print at the top of each page.

    Code i currently have is:
    Please Login or Register  to view this content.
    I just need it to now go across 10 visible columns and set as a single print area.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Dynamic Range to select only visible columns

    Same post. http://www.excelforum.com/excel-prog...n-columns.html

    There are some answers on the other one.

  3. #3
    Registered User
    Join Date
    12-11-2013
    Location
    auckland
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Dynamic Range to select only visible columns

    Quote Originally Posted by stnkynts View Post
    Same post. http://www.excelforum.com/excel-prog...n-columns.html

    There are some answers on the other one.

    The previous thread wasn't answered, each response had hard coded columns, this cant be the case

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: Dynamic Range to select only visible columns

    Hi morangeman,

    Does this help:

    Please Login or Register  to view this content.
    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  5. #5
    Registered User
    Join Date
    12-11-2013
    Location
    auckland
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Dynamic Range to select only visible columns

    This brings up a message box with every visible column in the entire sheet.

    the message box states the correct rows from A11 down to the lastrow but it only needs to go across 10 columns not the entire sheet. They need to be selected and set as a single print area.

  6. #6
    Registered User
    Join Date
    12-11-2013
    Location
    auckland
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Dynamic Range to select only visible columns

    Bump Please there must be some other options to make this work

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: Dynamic Range to select only visible columns

    This brings up a message box with every visible column in the entire sheet
    It doesn't for me

    When I run it it shows range for each visible column from column A to the last column used on the sheet.

    I've slightly tweaked the following to work with columns A to J (inclusive) only and to automatically set the print area:

    Please Login or Register  to view this content.
    Robert

  8. #8
    Registered User
    Join Date
    12-11-2013
    Location
    auckland
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Dynamic Range to select only visible columns

    Almost

    It doesn't seem to set the print area to the first 10 visible columns. It sets a print area of the correct dimensions going down but the print area seems to only go along to the first hidden column and stops. The hidden Columns start after column D but the print area is only being set for A, B, C and then stopping
    Last edited by morangeman; 05-06-2014 at 10:36 PM.

  9. #9
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: Dynamic Range to select only visible columns

    Try this:

    Please Login or Register  to view this content.
    Robert
    Last edited by Trebor76; 05-07-2014 at 12:14 AM.

+ 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] Code to select visible cell range only
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-23-2013, 03:05 AM
  2. Select Visible Cells in Specific Columns
    By RyanPJK in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-14-2013, 12:10 PM
  3. Dynamic Named Range on Visible cells
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2011, 02:42 PM
  4. Select Cell In Center Of Visible Range
    By Spencer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2011, 01:53 PM
  5. Select visible cells within a set range
    By longbow007 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-09-2010, 09:10 PM

Tags for this Thread

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