Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default TopLeftCell.Address for buttons from forms toolbar

Hi All

Is there an equivalent of:

Set rng = Range(ActiveSheet.Buttons(Application.Caller). _
TopLeftCell.Address)

for buttons from forms toolbar?

Cheers

Andy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default TopLeftCell.Address for buttons from forms toolbar

Andy wrote:
Hi All

Is there an equivalent of:

Set rng = Range(ActiveSheet.Buttons(Application.Caller). _
TopLeftCell.Address)

for buttons from forms toolbar?


Set rng = ActiveSheet.Buttons(Application.Caller).TopLeftCel l

works for me.


--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default TopLeftCell.Address for buttons from forms toolbar

Hi Andy,

Is there an equivalent of:

Set rng = Range(ActiveSheet.Buttons(Application.Caller). _
TopLeftCell.Address)

for buttons from forms toolbar?


That assignment statement *is* for a button from the Forms tool bar.


If you want to set the range from a Controls Toolbox button, try:

'==============
Private Sub CommandButton1_Click()
Dim rng As Range

Set rng = Range(Me.CommandButton1.TopLeftCell.Address)
End Sub
'<<==============


---
Regards,
Norman



"Andy" wrote in message
...
Hi All

Is there an equivalent of:

Set rng = Range(ActiveSheet.Buttons(Application.Caller). _
TopLeftCell.Address)

for buttons from forms toolbar?

Cheers

Andy



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default TopLeftCell.Address for buttons from forms toolbar

Thanks Norman and Dick, it's 4pm on Friday, thats my excuse. I meant it
the other way around, should have been is there an equivalent for
controls toolbox button.

Norman Jones wrote:
Hi Andy,


Is there an equivalent of:

Set rng = Range(ActiveSheet.Buttons(Application.Caller). _
TopLeftCell.Address)

for buttons from forms toolbar?



That assignment statement *is* for a button from the Forms tool bar.


If you want to set the range from a Controls Toolbox button, try:

'==============
Private Sub CommandButton1_Click()
Dim rng As Range

Set rng = Range(Me.CommandButton1.TopLeftCell.Address)
End Sub
'<<==============


---
Regards,
Norman



"Andy" wrote in message
...

Hi All

Is there an equivalent of:

Set rng = Range(ActiveSheet.Buttons(Application.Caller). _
TopLeftCell.Address)

for buttons from forms toolbar?

Cheers

Andy




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
Option Buttons from the Forms Toolbar - Excel 2003 mickey Excel Worksheet Functions 2 October 14th 07 11:32 AM
buttons on forms Jabba Excel Programming 1 March 31st 05 10:25 PM
Group buttons from the forms toolbar GregR Excel Discussion (Misc queries) 1 December 7th 04 01:25 AM
custom toolbar buttons are saved where? Excel loads twice bymistake and all my custom toolbar buttons get gone!!! Kevin Waite Excel Programming 2 March 3rd 04 03:31 PM
saving toolbar buttons on custom toolbar Paul James Excel Programming 12 August 6th 03 08:28 AM


All times are GMT +1. The time now is 09:30 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"