+ Reply to Thread
Results 1 to 4 of 4

Copy visible cells only to another sheet

  1. #1
    Registered User
    Join Date
    02-08-2017
    Location
    Montreal
    MS-Off Ver
    Mac 2011
    Posts
    2

    Copy visible cells only to another sheet

    Hello,

    I have a worksheet with a data Range(A1:F240) which spans across 3 Legal size pages.
    I programmed a macro to automatically hide empty rows across the range.
    The last 24 rows are always visible.

    What I'm trying to do now is print exactly what I see (only the visible rows) on 1 or 2 pages, without blanks.
    I figured I would, through a VBA macro, copy-paste the visibles cells to a scratch worksheet and then print that sheet.

    Please Login or Register  to view this content.
    Unfortunately, this code just carbon-copies the source worksheet INCLUDING hidden cells: My data still spans over the same 3 print areas, and my last 24 rows still print on the bottom of the 3rd page.

    Please help ��

    Thank you
    Last edited by laboutique; 02-08-2017 at 01:35 PM.

  2. #2
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Copy visible cells only to another sheet

    Have you tried setting the print area?

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,057

    Re: Copy visible cells only to another sheet

    Odd... your code should work and only copy visible cells, but the definition of "visible" is cells whose row/colun is not hidden
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Registered User
    Join Date
    02-08-2017
    Location
    Montreal
    MS-Off Ver
    Mac 2011
    Posts
    2

    Re: Copy visible cells only to another sheet

    Hello Arkadi,

    I just found why it behaved oddly.
    In order to keep the column and rows formatting, I manually duplicated the source sheet to make the target sheet.
    The source sheet has an embedded macro which hides empty rows on activate.

    This is why the target sheet kept hiding rows. ��

    How can I modify the code as to copy-paste the visible cells with the same row heights and column widths as the in source sheet?

    Thanks
    Last edited by laboutique; 02-08-2017 at 06:34 PM.

+ 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] macro to copy paste visible cells into a newly created sheet
    By melody10 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-19-2015, 04:14 PM
  2. Copy only visible cells on a sheet
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-03-2014, 02:13 PM
  3. Copy visible cells and then transfer output to another sheet.
    By jram in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-03-2012, 01:42 PM
  4. [SOLVED] Copy/Pasting Values from visible cells (using autofilter) to visible cells
    By evakotsi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2012, 07:49 AM
  5. [SOLVED] can only copy/select visible cells w autofilter on &hidden columns, want to copy all cells
    By JTwrk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-25-2012, 02:12 AM
  6. Copy Visible cells and paste values only to visible target cells
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2010, 04:09 AM
  7. Copy only Visible cells to another sheet in Macro? Runtime 438 error?
    By nbaj2k in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-18-2006, 11:30 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