+ Reply to Thread
Results 1 to 5 of 5

Syntax for Select Case

  1. #1
    Susan Hayes
    Guest

    Syntax for Select Case

    Hello, I am trying to do the following IF statement in Select Case Syntax

    In cell C9 I have written:

    =If(and(H9=P9,S9=0),"Filled",If(and(H9>P9,P9<>0),"Partial",""))

    I also need to have the above formula to work starting at C9 and continue down the entire C column, ie. C9, C10, . . .
    This includes the numeric data in columns H, P, S, starting on line 9 on down respectively.

    This would certainly get me started,

    Thank you,

    Susan


  2. #2
    Bob Phillips
    Guest

    Re: Syntax for Select Case

    What problem are you having? That formula works, maybe not as you wish, but
    it works.

    And why can you not just copy C9 to C10 etc.?

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Susan Hayes" <[email protected]> wrote in message
    news:[email protected]...
    > Hello, I am trying to do the following IF statement in Select Case Syntax
    >
    > In cell C9 I have written:
    >
    > =If(and(H9=P9,S9=0),"Filled",If(and(H9>P9,P9<>0),"Partial",""))
    >
    > I also need to have the above formula to work starting at C9 and continue

    down the entire C column, ie. C9, C10, . . .
    > This includes the numeric data in columns H, P, S, starting on line 9 on

    down respectively.
    >
    > This would certainly get me started,
    >
    > Thank you,
    >
    > Susan
    >




  3. #3
    Susan Hayes
    Guest

    Re: Syntax for Select Case

    The reason I wish to write the following formula in VBA is that the end users accidently delete the formula

    On Tue, 29 Nov 2005 19:20:35 -0500, Susan Hayes <[email protected]> wrote:

    >Hello, I am trying to do the following IF statement in Select Case Syntax
    >
    >In cell C9 I have written:
    >
    >=If(and(H9=P9,S9=0),"Filled",If(and(H9>P9,P9<>0),"Partial",""))
    >
    >I also need to have the above formula to work starting at C9 and continue down the entire C column, ie. C9, C10, . . .
    >This includes the numeric data in columns H, P, S, starting on line 9 on down respectively.
    >
    >This would certainly get me started,
    >
    >Thank you,
    >
    >Susan



  4. #4
    Bob Phillips
    Guest

    Re: Syntax for Select Case

    Dim iLastrow As Long
    Dim iLastrow2 As Long

    iLastrow = Cells(Rows.Count, "H").End(xlUp).Row
    iLastrow2 = Cells(Rows.Count, "P").End(xlUp).Row
    If iLastrow2 > i9lastrow Then
    iLastrow = iLastrow2
    End If
    Range("C9").Resize(iLastrow - 8).Formula = _

    "=If(and(H9=P9,S9=0),""Filled"",If(and(H9>P9,P9<>0),""Partial"",""""))"



    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Susan Hayes" <[email protected]> wrote in message
    news:[email protected]...
    > The reason I wish to write the following formula in VBA is that the end

    users accidently delete the formula
    >
    > On Tue, 29 Nov 2005 19:20:35 -0500, Susan Hayes <[email protected]> wrote:
    >
    > >Hello, I am trying to do the following IF statement in Select Case Syntax
    > >
    > >In cell C9 I have written:
    > >
    > >=If(and(H9=P9,S9=0),"Filled",If(and(H9>P9,P9<>0),"Partial",""))
    > >
    > >I also need to have the above formula to work starting at C9 and continue

    down the entire C column, ie. C9, C10, . . .
    > >This includes the numeric data in columns H, P, S, starting on line 9 on

    down respectively.
    > >
    > >This would certainly get me started,
    > >
    > >Thank you,
    > >
    > >Susan

    >




  5. #5
    Bob Phillips
    Guest

    Re: Syntax for Select Case

    Typo

    Dim iLastrow As Long
    Dim iLastrow2 As Long

    iLastrow = Cells(Rows.Count, "H").End(xlUp).Row
    iLastrow2 = Cells(Rows.Count, "P").End(xlUp).Row
    If iLastrow2 > ilastrow Then
    iLastrow = iLastrow2
    End If
    Range("C9").Resize(iLastrow - 8).Formula = _

    "=If(and(H9=P9,S9=0),""Filled"",If(and(H9>P9,P9<>0),""Partial"",""""))"


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > Dim iLastrow As Long
    > Dim iLastrow2 As Long
    >
    > iLastrow = Cells(Rows.Count, "H").End(xlUp).Row
    > iLastrow2 = Cells(Rows.Count, "P").End(xlUp).Row
    > If iLastrow2 > i9lastrow Then
    > iLastrow = iLastrow2
    > End If
    > Range("C9").Resize(iLastrow - 8).Formula = _
    >
    > "=If(and(H9=P9,S9=0),""Filled"",If(and(H9>P9,P9<>0),""Partial"",""""))"
    >
    >
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Susan Hayes" <[email protected]> wrote in message
    > news:[email protected]...
    > > The reason I wish to write the following formula in VBA is that the end

    > users accidently delete the formula
    > >
    > > On Tue, 29 Nov 2005 19:20:35 -0500, Susan Hayes <[email protected]>

    wrote:
    > >
    > > >Hello, I am trying to do the following IF statement in Select Case

    Syntax
    > > >
    > > >In cell C9 I have written:
    > > >
    > > >=If(and(H9=P9,S9=0),"Filled",If(and(H9>P9,P9<>0),"Partial",""))
    > > >
    > > >I also need to have the above formula to work starting at C9 and

    continue
    > down the entire C column, ie. C9, C10, . . .
    > > >This includes the numeric data in columns H, P, S, starting on line 9

    on
    > down respectively.
    > > >
    > > >This would certainly get me started,
    > > >
    > > >Thank you,
    > > >
    > > >Susan

    > >

    >
    >




+ 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