View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Find the cell that is the option button is on it

mental glitch

or forms toolbar, in the click event

set rng = Application.Caller


should be

or forms toolbar, in the click event

Dim btn as OptionButton, rng as Range
set btn = activesheet.OptionButtons(application.Caller)
set rng = btn.topleftcell

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote:

Which type of option button - control toolbox toolbar or forms toolbar?

for forms toolbar, in the click event

set rng = Application.Caller

If you are looping through option buttons, show the code and where you want
to know the cell below.

Or look at the topLeftCell property of the OleObject for control Toolbox
controls or for OptionButton object for forms controls

--
regards,
Tom Ogilvy

"SupperDuck" wrote:

Hello,

For example I have 400 option buttons, so i want to find on which cell they
are.

I mean, if option button is on cell (2,2) I want to know this.

Is it possible?

Regards,