+ Reply to Thread
Results 1 to 1 of 1

Copy from autofiltered range with hidden columns doesn't include hidden cells' content

  1. #1
    Registered User
    Join Date
    01-14-2014
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    1

    Copy from autofiltered range with hidden columns doesn't include hidden cells' content

    Hello,

    My goal is to create a macro that inserts a blank row just above a user-selected cell or row and copies formulas from the selected row into the new inserted row. Only formulas are to be copied, not constants. Cells with constant values in the copied row are left blank in the inserted row.

    Code is pretty basic. Here it is:
    Please Login or Register  to view this content.
    This works great in all but one situation.
    If the range contains both an activated auto-filter and hidden columns, then the content of the hidden cell on the copied row does not get selected by the copy method and is hence not transferred to the inserted line.
    If the range is only auto-filtered or only has hidden columns, then all works good.
    I've included a simple workbook with the above code and a simple table i've been using to test this issue.

    Testing of AddLine MAcro.xlsm

    This behavior is well documented here but no solution is offered.
    I haven't found anything else on the web.

    This behavior is identical when performing cut-and-paste (ctrl-C/ctrl-V ) operations manually directly from the spread sheet.
    So i would say it's not a VBA issue. But the solution may lay with VBA.
    Can anyone offer any suggestions or workarounds?

    Thanks,

    Fred

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy from autofiltered range with hidden columns doesn't include hidden cells' content

    Hi Fred

    Welcome to the Forum!!

    I too have had this issue and the only sure fired solution I've found is to unhide, do your stuff, then re-hide. Using your Code it would look something like this
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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. Replies: 0
    Last Post: 09-13-2012, 11:10 AM
  2. [SOLVED] Range.Value doesn't work in hidden columns
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2006, 03:05 PM
  3. Replies: 1
    Last Post: 10-14-2005, 08:05 AM
  4. macro to insert row, copy cells and keep hidden columns
    By steven_thomas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-26-2005, 04:40 PM
  5. COPY - *want* to include hidden columns
    By Eric in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2005, 09:05 AM

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