Compile Error: Expected: expression

JonRowland

Active Member
Joined
May 9, 2003
Messages
415
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

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

Basically if row <i>x</i> 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 <b>Compile Error: Expected: expression </b> error which has got me stumped.

Any ideas plse.
Thx
Jon


<code>
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

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

Next Row
</code>
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Change
Code:
If CC_Value > 0.5 AND <> "44" Then
to
Code:
If CC_Value > 0.5 AND CC_Value <> "44" Then
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,453
Members
448,967
Latest member
grijken

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top