View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Is Application.Caller valid in Functions but not Subs?

You can use ActiveCell (or maybe Selection, but Selection will include all the
selected cells).

And you can use application.caller in Subroutines--for instance, for instance if
you started the sub by clicking on a button from the forms toolbar (or any
control (I think) on that Forms toolbar.

Or a shape from the Drawing toolbar....

wrote:

This works fine in all Functions I've written but throws an 'Object
required' in a Sub I'm writing:

Dim R as Range
Set R = Application.Caller

If Application.Caller is invalid in a Sub, then what expression DO you
use in a Sub to return the cell the user was on when he launched the
Sub?

Thanks much.

***


--

Dave Peterson