What is the correct syntax?

    If fld.Name Not Like "Report*'" And fld.Name Not Like "Lvl*" And fld.Name Not Like "PRV*" And fld.Name Not Like "CURR*" Then


I am getting a syntax error in VBA

Thanks
kosenrufuAsked:
Who is Participating?
 
kosenrufuAuthor Commented:
I fixed it

It's If Not fld.Name Like "Report*" And Not fld.Name Like "Lvl*" And Not fld.Name Like "PRV*" And Not fld.Name Like "CURR*" Then
0
 
käµfm³d 👽Commented:
It looks like you've got an extra single quote in "Report*'". You can probably see it better below:
If fld.Name Not Like "Report*'" And fld.Name Not Like "Lvl*" And fld.Name Not Like "PRV*" And fld.Name Not Like "CURR*" Then

Open in new window

0
 
kosenrufuAuthor Commented:
I narrowed down the syntax to If fld.Name Not Like "Report*" Then

and still does not work
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
kosenrufuAuthor Commented:
It's

                If fld.Name Like Not "Report*" And fld.Name Like Not "Lvl*" And fld.Name Like Not "PRV*" And fld.Name Like Not "CURR*" Then

Like Not

But now I get a type mismatch when i run the script
0
 
aikimarkCommented:
Is there an End If statement?
0
 
kosenrufuAuthor Commented:
figured out
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.