Range.Find abend on XP/Excel 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Below code got subscript out of range abend on XP/Excel 2003, but works find
on excel 2000. Does range.Find function not working on Excel 2003? Any
suggestion?


oriReportStartRow = oriRowIndex + oriBlankLine + oriHeaderLine + oriTOTALLine
oriGPStart = oriReportStartRow
objSheet(orisheet).Cells(oriReportStartRow - 1, 1) = "Gross Profit"
objSheet(orisheet).Cells(oriReportStartRow - 1, 1).Font.Bold = True
oriRowIndex = oriReportStartRow

'test find statement
Dim oriSearch As Range
Set oriSearch = objSheet(orisheet).Range("A2:IV100").Find("Gross
Profit", LookIn:=xlValue) ----> Abend subscript out of range???
 
I finally figure out what is wrong, on excel 2000 Find function works on
both LookIn:=xlValue or LookIn:=xlValues. But Excel 2003 will abend with
subscript out of range when use LookIn:=xlValue

so the code shall change to :
Set oriSearch = objSheet(orisheet).Range("A2:IV100").Find("Gross
Profit", LookIn:=xlValues
 
xlvalue = xlValues?

But xl2003 won't crash when you're looking through values.

I'd still bet that your worksheet didn't exist.

orisheet may not be what you think it is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top