+ Reply to Thread
Results 1 to 2 of 2

For loop

  1. #1
    Registered User
    Join Date
    Perth, australia
    MS-Off Ver
    Excel 2007

    Red face For loop

    Hello peeps. Virgin poster here

    So look my problem is that I'm pretty
    Noob and I can't seem to write a for loop
    That meets the correct syntax requirements for VBA

    what I want is a piece of code that will
    Verify that if any cell in range c8:c16
    Contains "yes". Then I want to To Refer to
    Store the corresponding description(s) which are in the a8:a16 range

    Much like the vloOkup function
    However I need to process this data further so I cant use
    Vlookup. there will also be various instances of 'yes' and
    Various descriptions of the corresponding entities further impeding 'vlookup'

    This resembles something that I tried. It was put as function initialising on a button click event and it didn't work;

    Dim array1() as variant
    For I = 0 to 7
    If sheet1.range("c" & I).text = "yes" then
    Array1(I) = sheet1.range("a" & I).text
    End If

    And I'll be referring to the array(n) in a separate function
    That emails a list of people describing what's in cell a
    And a8,a9, etc .. If the corresponding c8,c9 contains 'yes'

    The ("c" & I) is an attempted concatenation
    Of c and the stepping variable I.e c8,c9, etc
    Last edited by Kazintsky; 02-06-2013 at 06:30 PM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    Dubai, UAE
    MS-Off Ver
    1997 - 2016

    Re: Example required

    HI Kazinstsky,

    welcome to the forum.
    Suggest you to change the thread title to reflect the query you are asking, also use code tags for your code, see forum rules:-


    <click on below * if this helps>
    +91 9810929744

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


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