LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
bryan
 
Posts: n/a
Default ClearContents method on a passed range

I want to create a range of results in one worksheet based on a range
of input values in another worksheet in the same workbook. I've
'named' the input and result ranges in Excel but am unable to clear
the result range using the following code called from Excel with
'=Test1(results)' speciified in a cell:

Public Function Test1(RangeResult As Range)

RangeResult.ClearContents

End Function

The code runs o.k. but the range isn't cleared and zero is returned. I
thought I was getting the hang of VBA but this has stumped me.
 
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
Passing a range name as an argument to the Index Function Michael Sharpe Excel Discussion (Misc queries) 3 September 5th 12 01:33 PM
Defined range difficulty Pat Excel Discussion (Misc queries) 7 January 16th 05 09:52 PM
Construct a range in VB Steve Excel Discussion (Misc queries) 3 December 29th 04 02:01 PM
named range refers to: in a chart Spencer Hutton Excel Discussion (Misc queries) 1 December 14th 04 10:15 PM
HTML_Control Range name Steven Cheng Excel Discussion (Misc queries) 4 December 10th 04 10:12 PM


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

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

About Us

"It's about Microsoft Excel"