+ Reply to Thread
Results 1 to 2 of 2

Excel 2007 : IF statement with VBA

  1. #1
    Registered User
    Join Date
    02-14-2010
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Post IF statement with VBA

    Hi,

    I don't have a lot of experience working with excel macros or VBA, but I understand how it works. Could anyone help me with this? It's is not complex, it just me because i dont know the syntax of VbA.
    Here is what i need.

    I have excel spreadsheet.

    And A1:A10, is a TEXT for example A1="Blue..",A2="Green..",A3="Red..",A4="Red.."
    And there is another column C1:C10, for example(numbers) C1="3.44",C2="4.55"....
    And there are 3 cells, D1(blue),D2(green),D3(red).

    I need something like this:

    pseudo code
    Please Login or Register  to view this content.
    To make it even more clear, Ai = A + i = ex, A1,A2.. same with Ci, i is row number.

    As you can see it is a very basic program, it basicly loops through the cells and if it finds what he is looking for it adds the number, which is in the same line it found it, fills with other text.

    I don't except you to do it for me, but i would really appreaciate the example or a where to start.

    Thank you
    Last edited by teylyn; 02-15-2010 at 03:30 AM. Reason: added code tags

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: IF statement with VBA

    Hi Endriuska
    For starters try typing "Select Case" into a module , then highlight it and press "F1"
    then look at "Cell" the same way
    Your basic logic is OK you just need to add the expression syntax
    Have a go and post your code
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

+ 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