Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help on coercing a range
I have a problem with trying to get a range specified the way a subroutine
wants it. I am trying to .clearcontents of a range in a sheet. Here is the code: ' clear the explainations Application.Goto reference:="ABC_" & Group_Name & "_Start" Set StartRange = ActiveCell ' *** function LastRow returns the row number as long lngEndRow = LastRow Set EndRange = StartRange.Offset(lngEndRow - StartRange.Row, 0) Here is the problem. I am getting: an Error 91 Object variable or with block variable not set. I am trying to pass the Find_Range function "$A$10:$A$137" immediate shows that StartRange.address is "$A$10" and the endrange is "$A$137" (but maybe the quotes really aren't there but show in the Immediate. Find_Range("Explainations", Range(StartRange.Address & ":" & EndRange.Address)).Select ActiveCell.Offset(1, 0).Select Selection.ClearContents Can you please tell me how to do this? Thanks, rick |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help on coercing a range
Sorry group, I found the error. I spelled Explanations wrong. The Range
structures are fine. .... rick "rick" wrote in message ... I have a problem with trying to get a range specified the way a subroutine wants it. I am trying to .clearcontents of a range in a sheet. Here is the code: ' clear the explainations Application.Goto reference:="ABC_" & Group_Name & "_Start" Set StartRange = ActiveCell ' *** function LastRow returns the row number as long lngEndRow = LastRow Set EndRange = StartRange.Offset(lngEndRow - StartRange.Row, 0) Here is the problem. I am getting: an Error 91 Object variable or with block variable not set. I am trying to pass the Find_Range function "$A$10:$A$137" immediate shows that StartRange.address is "$A$10" and the endrange is "$A$137" (but maybe the quotes really aren't there but show in the Immediate. Find_Range("Explainations", Range(StartRange.Address & ":" & EndRange.Address)).Select ActiveCell.Offset(1, 0).Select Selection.ClearContents Can you please tell me how to do this? Thanks, rick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I enter formula sum(range+range)*0.15 sumif(range=3) | Excel Discussion (Misc queries) | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
Coercing a variant into an array | Excel Programming | |||
Range.Find returns cell outside of range when range set to single cell | Excel Programming | |||
how to? set my range= my UDF argument (range vs. value in range) [advanced?] | Excel Programming |