Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Compile Error: Expected: expression

  1. #1
    Board Regular
    Join Date
    May 2003
    Posts
    363
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Compile Error: Expected: expression

    Hi Guys,

    Am stuck on the following piece of code for what I thought was a straightforward loop.

    Basically if row x in Column L isn't blank or 44 then I want to combine it with the value in Column C.

    However, the red piece of code is giving me a Compile Error: Expected: expression error which has got me stumped.

    Any ideas plse.
    Thx
    Jon



    Dim CC_Value As String
    Dim S_No As String
    Dim D_No As String

    StartRow = 2

    LastRow = Cells.Find("*", Cells(1), xlFormulas, xlWhole, xlByRows, xlPrevious).Row

    For Row = StartRow To LastRow Step 1

    CC_Value = Cells(Row, 12)
    D_No = Cells(Row, 3)

    If Cells(2, 16).Value = "Inbound" Then
    If CC_Value < 0.5 Then
    End If

    If CC_Value > 0.5 AND <> "44" Then
    Cells(Row, 3).Value = CC_Value & D_No
    End If
    End If

    Next Row

  2. #2
    Board Regular Michael M's Avatar
    Join Date
    Oct 2005
    Location
    South Western NSW
    Posts
    16,440
    Post Thanks / Like
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Compile Error: Expected: expression

    Change
    Code:
    If CC_Value > 0.5 AND <> "44" Then
    to
    Code:
    If CC_Value > 0.5 AND CC_Value <> "44" Then
    Regards
    Michael M
    ---------------------------------------
    The more I learn, the less I seem to know.....A Please and Thank You cost nothing !
    It's easier to debug if we can see the whole macro !
    Home 2007 & 2013

    - Posting guidelines, forum rules and terms of use

    - To download Mr Excel HTML Maker

    - Try searching for your answer first, see how

    - Read the FAQs

    - List of BB codes


    [CODE]Place Your Code Here[/CODE]

  3. #3
    Board Regular
    Join Date
    May 2003
    Posts
    363
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Re: Compile Error: Expected: expression

    Ah Michael M...so simple I overlooked it.

    Thx a lot.

    Jon

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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