The code below works fine in a XL VBA module but when I add it to my Access VBA module it produces an error. I suspect it needs to be modified but am unsure what to change.
Can someone point me in the right direction?
x = objWorkbook.Worksheets(lngCount).Application.Match("[All Markets]", Range("1:1"), 0)
y = objWorkbook.Worksheets(lngCount).Application.Match("[All Products]", Range("1:1"), 0)
objWorkbook.Worksheets(lngCount).Range(Cells(x).Offset(, 1), Cells.Offset(, -1)).EntireColumn.Delete
Can someone point me in the right direction?
x = objWorkbook.Worksheets(lngCount).Application.Match("[All Markets]", Range("1:1"), 0)
y = objWorkbook.Worksheets(lngCount).Application.Match("[All Products]", Range("1:1"), 0)
objWorkbook.Worksheets(lngCount).Range(Cells(x).Offset(, 1), Cells.Offset(, -1)).EntireColumn.Delete