+ Reply to Thread
Results 1 to 3 of 3

Setting a cell based on the conents of another

  1. #1
    Registered User
    Join Date
    06-28-2012
    Location
    Indiana
    MS-Off Ver
    Excel 2003
    Posts
    2

    Setting a cell based on the conents of another

    Hey everyone,

    I'm working on a workbook that imports data from another source and then displays it nicely in excel. One of my worksheets displays an inventory. On this sheet is a column called "Source" (column D) and and several columns that are only relevant for purchased items. However, if the inventory item's source is "Manufactured", there is no need for these columns, so I would like these cells greyed out in the row for a manufactured item.
    The code that I currently have is:

    Please Login or Register  to view this content.
    Where n is the current row that is cycled through with a for loop.

    My intention is that this checks the cell in the source column to see if it is marked "Manufactured," and if it is, then fills in the cells in the vendor columns with a gray background. However, it just fills in the Vendor columns if the "Source" column is empty, and leaves them blank if it contains any term at all.

    What am I doing wrong?

    Thanks in advance for any help,
    Zach

    PS. I do realize that the Offset property is being used, that is taking into account columns that had to be added in a different part of the code.

  2. #2
    Forum Contributor wallyeye's Avatar
    Join Date
    05-06-2011
    Location
    Arizona
    MS-Off Ver
    Office 2010, 2007
    Posts
    308

    Re: Setting a cell based on the conents of another

    I'm assuming Manufactured is not a variable containing the text "Manufactured"? You just need to wrap it in quotes:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-28-2012
    Location
    Indiana
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Setting a cell based on the conents of another

    Works great now, can't believe I didn't think of that.

    Thanks

+ 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