+ Reply to Thread
Results 1 to 3 of 3

Macro to loop through cell values in a column and format multiple cell values

  1. #1
    Registered User
    Join Date
    12-15-2010
    Location
    Oregon, USA
    MS-Off Ver
    Excel 2007
    Posts
    48

    Macro to loop through cell values in a column and format multiple cell values

    Hi Guys,
    I have worksheet with a column with mutliple cell values. I am looking for a macro to loop through each cell ina column and do the following:-
    • If there is only one value in a cell then keep it.
      otherwise
      If there are multiple entries in a cell then just keep the second entry and delete the first, third, so on.

    I have attached a sample sheet with two tabs " Original" and "formatted data" to show what i am looking for.

    Any help will be much appreciated.

    Thanks.

    Roop
    Attached Files Attached Files
    Last edited by Roop; 06-07-2012 at 05:39 PM.

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Macro to loop through cell values in a column and format multiple cell values

    Backup your data.
    Place the code below in a standard module (ask if you don't know what that is).
    Run: DeleteExtraItemsInColumnB

    Please Login or Register  to view this content.
    If you have any questions, please ask.

  3. #3
    Registered User
    Join Date
    12-15-2010
    Location
    Oregon, USA
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Macro to loop through cell values in a column and format multiple cell values

    Hi Steven,
    This works perfect.
    Thanks alot.

    Roop.

    Quote Originally Posted by StevenM View Post
    Backup your data.
    Place the code below in a standard module (ask if you don't know what that is).
    Run: DeleteExtraItemsInColumnB

    Please Login or Register  to view this content.
    If you have any questions, please ask.

+ 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