Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Coercing a variant into an array Alex T Excel Programming 1 November 18th 04 09:54 PM
Range.Find returns cell outside of range when range set to single cell Frank Jones Excel Programming 12 June 10th 04 04:22 AM
how to? set my range= my UDF argument (range vs. value in range) [advanced?] Keith R[_3_] Excel Programming 2 August 11th 03 05:55 PM


All times are GMT +1. The time now is 09:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"