+ Reply to Thread
Results 1 to 4 of 4

VBA Copy certain cells then loop

  1. #1
    Registered User
    Join Date
    03-25-2012
    Location
    England
    MS-Off Ver
    Excel 2007 & Excel 2011 for Mac
    Posts
    79

    VBA Copy certain cells then loop

    Hi,

    Is it possible to code the following......

    Column A has data from cells A1 to A20

    In cell A1 is the value [Apple] (text is in square brackets, and only these headings are in brackets)

    then in A5 is the value [Banana]

    and again in A12 is the value [Pear]

    the code I need will select the cell containing [Apple] the copy down until it reaches the cell above [Banana] and past into C1, it will then loop through copying from [Banana] down to the cell above [Pear] and paste into D1 and so on and so forth.

    Any ideas anyone??

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Copy certain cells then loop

    Hi zhb12810,

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    03-25-2012
    Location
    England
    MS-Off Ver
    Excel 2007 & Excel 2011 for Mac
    Posts
    79

    Re: VBA Copy certain cells then loop

    Exactly what I needed, thanks a lot

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Copy certain cells then loop

    You're welcome!

+ 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