+ Reply to Thread
Results 1 to 7 of 7

If then for acopy paste

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    If then for acopy paste

    I'm looking for a fairly simple if then macro to do the following (but in code that actually works).

    Please Login or Register  to view this content.
    loop through A100
    repeat with columns B, C, D, E, F.....P

    (In other words, I want all cells that read "no" to have the same text as the cell at the top of the column.)

    There should be a simple example attached.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: If then for acopy paste

    See if this helps
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: If then for acopy paste

    Weirdly. It worked once at copying A1 to all the cells with "no", but now it doesn't do anything. I haven't changed anything. I've never had a macro run only once.

    Also, I didn't want to copy A1 to all the cells. I wanted to copy the top of the column. So if cell B6 = No, then I wanted to copy B1. If D56 = No, then I wanted to copy D1.

    Thanks for the quick post. Seems like your solution is pretty close.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: If then for acopy paste

    Try:

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: If then for acopy paste

    Apologies, seems like I misinterpreted top of the column as 'always A1' , Mumps1 solution should do the exact trick for you.. Update thread as "solved" if its query is resolved. Thanks.

  6. #6
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: If then for acopy paste

    Quote Originally Posted by Jiptastic View Post
    Weirdly. It worked once at copying A1 to all the cells with "no", but now it doesn't do anything. I haven't changed anything. I've never had a macro run only once.
    May be that's because once you run this macro, there is no cell left in the given range with 'no' in it.

  7. #7
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: If then for acopy paste

    Not only is this solution brilliant. But it's brilliant.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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