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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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