empty range causes error
Dim TestRng as range
set testrng = nothing
on error resume next
set testrng = worksheets("somesheetnamehere").range("bloc1")
on error goto 0
if testrng is nothing then
'no range!
else
msgbox testrng.rows.count
end if
mwam423 wrote:
greetings! i'm pulling data, in the form of dynamic ranges from other tabs,
into a consolidated sheet. sometimes the ranges are empty, either there is
no data or we're waiting for data to be entered, and that seems to be causing
a problem.
part of macro determines how many rows the range is:
range("bloc1").rows.count, so that i know how many rows to drop down when
placing blocs of data from subsequent tabs. however, when the range is empty
"rows.count" seems to give me an error.
any ideas, assistance would be greatly appreciated, thanks
--
Dave Peterson
|