+ Reply to Thread
Results 1 to 6 of 6

Visible rows copy to different worksheet

Hybrid View

Craigm Visible rows copy to... 06-30-2005, 01:46 PM
Raman325 Not sure if this will do it... 06-30-2005, 01:52 PM
Guest RE: Visible rows copy to... 06-30-2005, 03:05 PM
Craigm Thanks for the suggestions... 06-30-2005, 04:01 PM
Guest Re: Visible rows copy to... 06-30-2005, 06:05 PM
Craigm Visible rows only-... 07-01-2005, 04:25 AM
  1. #1
    Registered User
    Join Date
    06-16-2005
    Posts
    62

    Arrow Visible rows copy to different worksheet

    ActiveSheet.Outline.ShowLevels RowLevels:=2

    In a macro I set a data filter to obtain Subtotals (like on the data menu). Now instead of 8,000 rows I have 50 Subtotal rows that are visible. The numbers of rows varies by data set.

    When I copy the data (to a different worksheet) all 8,000 rows are copied.

    How do I copy only the visible rows?

    Cornfused but ultimately greatful for your help.

    Craigm

  2. #2
    Registered User
    Join Date
    06-29-2005
    Posts
    46
    Not sure if this will do it and this might be a slow way to handle it but u could take it line by line, check to see if its visible, and if so copy and paste into the next line on the second sheet. You would have to have two counters, one for the individual rows in the original sheet and one for the rows in the second sheet

  3. #3
    Jim Thomlinson
    Guest

    RE: Visible rows copy to different worksheet

    Select the cells that you want to copy -> Hit F5 -> Special (Bottom Left
    Corner) -> Select Visible Cells Only -> Ok -> Right Click -> Copy ... and you
    can paste this wherever you want... This can also be done in code if you need
    that...
    --
    HTH...

    Jim Thomlinson


    "Craigm" wrote:

    >
    > ActiveSheet.Outline.ShowLevels RowLevels:=2
    >
    > In a macro I set a data filter to obtain Subtotals (like on the data
    > menu). Now instead of 8,000 rows I have 50 Subtotal rows that are
    > visible. The numbers of rows varies by data set.
    >
    > When I copy the data (to a different worksheet) all 8,000 rows are
    > copied.
    >
    > How do I copy only the visible rows?
    >
    > Cornfused but ultimately greatful for your help.
    >
    > Craigm
    >
    >
    > --
    > Craigm
    > ------------------------------------------------------------------------
    > Craigm's Profile: http://www.excelforum.com/member.php...o&userid=24381
    > View this thread: http://www.excelforum.com/showthread...hreadid=383640
    >
    >


  4. #4
    Registered User
    Join Date
    06-16-2005
    Posts
    62

    Question Thanks for the suggestions but there must be an easier way.

    I am forcing the copy with a For loop to run all the way down the worksheet (all 8,000 rows) and copy the data to a new worksheet using InStr to find my "Totals".

    There must be a way to only copy the visible cells to another worksheet?

    I cannot even chart with the autofilter on as the data exceeds the number of rows as input to the chart.

    I am a lost puppy at this point.
    --------------------------------------
    All of your input is valuable!

    Thanks, Craigm

  5. #5
    Jim Thomlinson
    Guest

    Re: Visible rows copy to different worksheet

    Sorry about taking so long to get back to you... Is there a reason that you
    are looping instead of using find and findnext? Other than that a range has a
    property called specialcell which takes an argument (in this case
    xlVisibleCellsOnly) so something like this.
    Range("A1:A8000").specialcells(xlVisibleCellsOnly).copy

    If you want help with the find - find next which would be a pile more
    efficient just ask...


    --
    HTH...

    Jim Thomlinson


    "Craigm" wrote:

    >
    > I am forcing the copy with a For loop to run all the way down the
    > worksheet (all 8,000 rows) and copy the data to a new worksheet using
    > InStr to find my "Totals".
    >
    > There must be a way to only copy the visible cells to another
    > worksheet?
    >
    > I cannot even chart with the autofilter on as the data exceeds the
    > number of rows as input to the chart.
    >
    > I am a lost puppy at this point.
    > --------------------------------------
    > All of your input is valuable!
    >
    > Thanks, Craigm
    >
    >
    > --
    > Craigm
    > ------------------------------------------------------------------------
    > Craigm's Profile: http://www.excelforum.com/member.php...o&userid=24381
    > View this thread: http://www.excelforum.com/showthread...hreadid=383640
    >
    >


  6. #6
    Registered User
    Join Date
    06-16-2005
    Posts
    62

    Arrow Visible rows only- xlVisibleCellsOnly? Find Next?

    I'm askin...I'm askin!: Help with Find and Find Next?

    I'm using the Subtotals funtionality in macros. I get 50 Subtotal rows (instead of 8,000 original rows). I need to copy the 50 visible rows to a new worksheet. I am doing this brute force with a For loop.

    If there is a better way "Find Next" or copy "xlVisibleCellsOnly" I would appreciate your help in understanding the methods.

    Thanks! Craigm

+ 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