R
Raymond Langsford
I've been fighting an intermittent problem in VBA code. I pass in a Range r
and want to look through a particular column of that range.
Dim c as Range
for each c in r.columns(col)
if c.value = target then
endif
next c
Usually this works fine. However, in certain as-yet-mysterious
circumstances, instead of c getting Range values consisting of single cells
from the column, c.Address( ) is the same as r.Address( ), and even more
perplexing to me, c.value give a Type Mismatch error, and when I put c in a
watch window, there is no Value property (although there is always a Value2
property). What is going on? How can I go about debugging this?
Thnx for any help.
Raymond Langsford
and want to look through a particular column of that range.
Dim c as Range
for each c in r.columns(col)
if c.value = target then
endif
next c
Usually this works fine. However, in certain as-yet-mysterious
circumstances, instead of c getting Range values consisting of single cells
from the column, c.Address( ) is the same as r.Address( ), and even more
perplexing to me, c.value give a Type Mismatch error, and when I put c in a
watch window, there is no Value property (although there is always a Value2
property). What is going on? How can I go about debugging this?
Thnx for any help.
Raymond Langsford