Syntax error If Or stmt

dmqueen

Board Regular
Joined
Aug 5, 2014
Messages
53
Hello,

For the life of me I cannot find the syntax error in my If Or stmt. I'm hoping fresh eyes an spot it. I tried to clearly mark the problem line with comments, its the line looking for the Notes field. I'd love any help, Thanks!

<code>
Sub fInput_Complete()
'Validate Entries
'copy listbox selections to worksheet
'go to next col
'col B
'verify entry was made
'go to next col
Dim NewRowNum As Integer
'Celllink 3 ROWS ABOVE for bound item where listboxes!!
'Start off in Column B
'Find the row just like in input begin: loop from the top until =, then one down
ActiveSheet.Range("A1").Select
'goto the top, and cycle down each line until you find the top of the entries, "="
'goto the top entry ready to insert the new entry
While ActiveCell.Value <> "="
ActiveCell.Offset(1, 0).Activate
Wend
'OK, we're on the new entry line
Dim EntryRowNum As Integer
Dim EntryColNum As Integer
Dim counter As Integer
counter = 0

EntryRowNum = ActiveCell.Row
'Entry starts in Col B
'Start checking for empties!
Do While counter > 26
counter = counter + 1
Application.ActiveCell.Offset(0, 1).Activate
EntryColNum = Application.ActiveCell.Column
If ActiveCell.Value = Null Then
Call MsgBox("Please enter a value to continue!", vbCritical, Application.Name)
Else:
If ActiveCell.Offset(-3, 1) > 1 Then
'It's a listbox, copy the selected value into the worksheet
EntryColNum = Application.ActiveCell.Column
Application.ActiveCell(EntryRowNum & EntryColNum).Select.Value = ActiveSheet.ListBox.bounditem.Value
Else:
'Ck for Notes field: only allowable blank
'SYNTAX ERROR FROM COMPILER ON NEXT LINE!!!
'/************************************************************************************************************************************************************
If Application.ActiveCell.Offset(-2,1) = "Notes" OR Application.ActiveCell.Offset(-3,1) = "Notes" OR Application.ActiveCell.Offset(-4,1) ="Notes") Then
Loop
End If

End If
Exit Do
End If
End Sub
</code>
 
Last edited:

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Just a guess. I see three opening parenthesis and four closing parenthesis.
 
Upvote 0
<code>.Offset(-4,1) ="Notes") Then</code>
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,543
Members
449,316
Latest member
sravya

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