+ Reply to Thread
Results 1 to 4 of 4

Changing cell contents

  1. #1
    Registered User
    Join Date
    10-19-2011
    Location
    Canada
    MS-Off Ver
    Microsoft Office for Macs 2011
    Posts
    2

    Changing cell contents

    Hello,
    I am using Office for Macs 2011. Please see attachment for example.
    I need to replace the names given in column B with the number given in column A (ie. change columns AB to look like columns DE). Problem is that there are over 300,000 rows in the file, so I cannot do it by hand. Is there a quick way to do this in excel?

    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Changing cell contents

    You don't really need a macro:

    1) In B1, put this formula:

    =IF($A2="", LOOKUP(99^99, $A$2:$A2), "")

    2) Copy B1 down the data set

    3) Copy column B, then Edit > Paste Special > Values to remove the formulas.



    Here's a macro version of those same steps:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 10-19-2011 at 03:42 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-19-2011
    Location
    Canada
    MS-Off Ver
    Microsoft Office for Macs 2011
    Posts
    2

    Re: Changing cell contents

    Hi JB,
    Thanks for the quick response. It is working so far great. A quick question though, is there a way to apply the formula to all of the rows in column B without having to pull down the formula from the cell above? I have over 300,000 cells, so this will take a long time. Because there are blank rows, I cannot just double click to auto fill...
    thanks

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Changing cell contents

    Try the macro.

+ 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