Run-Time Error 1004 - Excel 97


Posted by Tuc on July 12, 2001 8:35 AM

Hi Gang!

Simple thing. I'm trying to grab a value using row and column indexs of the cells collection. I'm encountering the dreaded 1004 Run-Time error. In the past I've activated a range to get to the worksheet directly and get past this error. Now I'm stumped. Here's the code that I'm using:

strHolder = ActiveSheet.Cells(lngRow, lngCol).Value

Ideas?

Thanks,

Tuc



Posted by Tuc on July 12, 2001 9:07 AM

Follow up. Here's how I got around it...

Since the goal was to find the value of a row in relation to another cell in the same colum, I thought about using the offset method and it gave me a solution that would work. Here's the code I used:
strHolder = rngTarget.Offset(-(rngTarget.Row - lngRow)).Value

I still would like to know a better way.

Thanks,

Tuc