mellymelle
New Member
- Joined
- Nov 25, 2016
- Messages
- 45
This is part of a larger code to find column numbers of matching headings and deleting such columns.
The code is returning runtime error 91 object variable or with block variable not set...any ideas?
Code:
Dim DateFind As Range, DateCol As Long
Set DateFind = Sheet1.Rows(1).Find(What:="Date", LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False).Column
DateCol = DateFind.Column
Columns(DateCol).EntireColumn.Delete
The code is returning runtime error 91 object variable or with block variable not set...any ideas?
Last edited: