+ Reply to Thread
Results 1 to 4 of 4

If cell contains ( ) then enter value to another cell in same row

  1. #1
    Registered User
    Join Date
    11-14-2012
    Location
    Dover
    MS-Off Ver
    Excel 2010
    Posts
    5

    If cell contains ( ) then enter value to another cell in same row

    I have a large excel sheet that contains various columns containing data for products. The "A" column contains Product Reference and the "N" column contains live stock values.
    I am trying to get rid of all products with a zero stock level, the problem is the master product has a zero value in the "N" column so if I delete all zero value products I'll loose my master product. Here is an example of my "Product Reference" for a product:

    002320 BLU
    002320 BLU(L)
    002320 BLU(M)
    002320 BLU(S)
    002320 BLU(XL)
    002320 BLU(XXL)

    Is it possible to run a macro that will look in column "A" for the ( character and place a value of 500 in the corresponding "N" column cell? I choose 500 so that I can then remove all products with a zero value and will know that all values with 500 are master products.

    Hope this makes sense.

  2. #2
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: If cell contains ( ) then enter value to another cell in same row

    Hello - welcome to the forum. I think you need to provide more details and upload a sample workbook as its not very clear with the info you have provided.
    If solved kindly remember to mark Thread as solved.
    Click the small star icon at the bottom left of my post if this was useful.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: If cell contains ( ) then enter value to another cell in same row

    try this, assuming you're data starts in A1...

    =IF(ISNUMBER(SEARCH("(",A1,1)),500,0)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    11-14-2012
    Location
    Dover
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: If cell contains ( ) then enter value to another cell in same row

    Thanks FDibbins, just what I wanted!!!

    [Solved]

+ 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