+ Reply to Thread
Results 1 to 6 of 6

selecting visible rows

  1. #1
    Spammer
    Join Date
    02-12-2007
    Posts
    22

    Question selecting visible rows

    hi all , i need to be able to select only visible rows and columns that contain data, eg if columns A,B,C,D,E up to row 26 for example, then i want to select this group, copy it and then transfer it all to sheet 2, (even if there are a couple of blanks in the selection i want to include them also) if more rows of data is included then they will be included as well, if this is possible then can it be used in a macro? and if so how do i go about it please?

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Do you mean visible as in "not hidden" or visible as in "within the current scroll area"?

    If the former, you could use
    Please Login or Register  to view this content.
    Last edited by mikerickson; 04-14-2007 at 11:45 AM.

  3. #3
    Spammer
    Join Date
    02-12-2007
    Posts
    22
    Quote Originally Posted by mikerickson
    Do you mean visible as in "not hidden" or visible as in "within the current scroll area"?

    If the former, you could use
    Please Login or Register  to view this content.



    hi i mean within the current scroll area.
    and i am sorry but i dont understand your reply as it is above my head , can you explain your solution a bit more simpler for me to understand please as i am a newbie to this

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    The VB code
    Please Login or Register  to view this content.
    will return the range of cells that is currently visible in the window. The .SpecialCells is to eliminate those rows that would be in the window, but have been hidden.
    This macro
    Please Login or Register  to view this content.
    will select that.
    This macro will copy the values (equivilant to Copy/PasteSpecialValues) in that range to the same range on "sheet2"
    Please Login or Register  to view this content.
    This one copies formulas (equivilant to Copy/Paste)
    Please Login or Register  to view this content.

  5. #5
    Spammer
    Join Date
    02-12-2007
    Posts
    22
    i can see how the codes work but i just want it to select rows with data in and not if they contain blank rows

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Add this line of code.
    Please Login or Register  to view this content.

+ 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