+ Reply to Thread
Results 1 to 5 of 5

Excel VBA help

  1. #1
    Registered User
    Join Date
    04-17-2008
    Posts
    3

    Excel VBA help

    I know the basics of excel, making equations and the like, but I am told that in order to make if statements that control formatting I will have to use VBA. I am completely new to VBA but not to programming as a whole. Any help or pointers to where I can learn about this specific issue would help.

    Ideally I'm trying to make it so when the inventory count on the item is 0, the entire row is coloured light grey.

    step 2 would be if the "state" column reads "New" then colour it blue, red for "untested"

    basically:
    IF F44>0 AND D44="New"{
    Row44textcolour="blue"
    }
    ELSEIF F44>0 AND D44="Untested"{
    Row44textcolour="red"
    }
    ELSEIF F44>0{
    Row44textcolour="black"
    }
    ELSE Row44textcolour="light grey"




    any suggestions?
    Last edited by Diomeneus; 04-17-2008 at 11:01 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You don't need VBA, you can use Conditional Formatting, se

    http://www.excel-it.com/excel_tutorials.htm
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    04-17-2008
    Posts
    3
    ah! most excellent! Worked perfectly thank you.

    Oh, and this question is a little more stupid. Is there a way to add constraints to a cell? As in your only choices to type in are blank, "new", "untested" or "working" ?
    Last edited by Diomeneus; 04-17-2008 at 11:36 AM.

  4. #4
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Yes. You can use a Data Validation.

    Go to TOOLS-DATA-VALIDATION. Choose LIST, and list your values separated by commas.

  5. #5
    Registered User
    Join Date
    04-17-2008
    Posts
    3
    once again, 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