Confirming multiple column titles are present

tomleitch

Board Regular
Joined
Jan 3, 2012
Messages
189
I'm trying to check if certain column titles are present in a header row


Code:
lcol = Sheets("UPDATE TOOL").Cells(Columns.Count).End(xlToLeft).Colum

Set Rng = Sheets("UPDATE TOOL").Range("A1", Sheets("UPDATE TOOL").Cells(1, lcol))


If Not IsError(Application.Match("Last reissue date", Rng, 0)) Then
If Not IsError(Application.Match("Risk Assessment Level", Rng, 0)) Then
If Not IsError(Application.Match("Function", Rng, 0)) = True Then
Call Sheets("OPS PLANNER").PermitImport
Exit Sub
End If
End If
End If

I can't seem to get it to work.... it's just throwing up an error 438.

Any help appreciated!
Thanks
Tom
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You've got a typo at the end of the first line ;)
 
Upvote 0
You left out the "n" (in red). Try:
Code:
lcol = Sheets("UPDATE TOOL").Cells(Columns.Count).End(xlToLeft).Colum[COLOR="#FF0000"]n[/COLOR]
 
Upvote 0
Well that was easier than expected!

And I'd been looking at that for a good half hour trying to see where I'd gone wrong and trying various things!


Many thanks everyone :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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