Consulting

Results 1 to 3 of 3

Thread: Solved: Using Variable Cell in IF Statement Formula

  1. #1
    VBAX Regular
    Joined
    Oct 2010
    Posts
    14
    Location

    Solved: Using Variable Cell in IF Statement Formula

    Hi,
    I'm having problems with getting the syntax of displaying A[Row] as A63 to A67 in the formula. I want logical test of the IF statement to check A63 through A67. Row is stored in a variable that increases every iteration.
    Any help is appreciated. Thanks.

    [vba]
    Row = 63
    Do Until Row > 67
    For Col = 4 To 7
    Cells(Row, Col).Select
    ActiveCell.FormulaR1C1 = "=IF( A[Row] = ""Item1"", "1", "0" )

    Next Col
    Row = Row + 1
    Loop
    [/vba]

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    For Col = 4 To 7
    Cells(Row, Col).Formula = "=IF(A" & (Col + 59) & "=""Item1"",1,0)"
    Next Col
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Oct 2010
    Posts
    14
    Location
    Thanks alot, problem solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •