below is a piece of code that works on xlsx
files but not on the csv
files, at least I suspect so.
The aim of the code is to find a column name e.g. ProductType
and return the column number in which the said column name is stored.
Again, this piece of code works perfectly when I run it on xslx
file types, however doing so on the csv
files does not work.
Any help is appreciated.
Sub ma1()
Dim RA As Excel.Workbook
Set RA = Workbooks.Open("G:\depts\Pri\RA.csv")
RA_col = RA.Sheets(1).Cells.Find(What:="ProductType", MatchCase:=True, LookAt:=xlWhole).Column
Debug.Print (RA_col)
End Sub