+ Reply to Thread
Results 1 to 5 of 5

Cell copying

  1. #1
    Registered User
    Join Date
    01-23-2010
    Location
    poland
    MS-Off Ver
    Excel 2003
    Posts
    2

    Cell copying

    i'm writeing Excel 2003 & Crystal Reports 9 application. i have 2 sheets: in firs i have name, adres, city etc and i must copy only that cells with are not empty. how to make it automaticly by loop in VBA?

    please help

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Cell copying

    Rather than looping, it is probably best to filter out non-blanks, then use the SpecialCells(xlCellTypeVisible) property to copy only visible cells as a block. You won't need a loop for this and it more efficient than iterating through each cell.

    Post a sample workbook (non-sensitive, dummy-data) for more help and provide a clear explanation of the expected results.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    01-23-2010
    Location
    poland
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Cell copying

    i upload 2 sheets in first is before "sorting & copying" an in second is after that - i want to have make it automaticly - any sugestions ?

    ---
    thanks ;-)
    Attached Files Attached Files

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Cell copying

    you could make use of autofilter heres a slightly tidied up recorded macro
    Please Login or Register  to view this content.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Cell copying

    Per my previous suggestion and refining Leith's code . . .

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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