Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default The cell address of a button?

I have a worksheet with data from each month arranged in
rows. For example, Rows 1-5 have January data, row 6 is
blank, Rows 7-12 have February data, etc.

In the first row of each month's data (in Column E), I
have a button that allows the user to erase the data only
for the month associated with the button. Is there any
way to determine where (Row and Column address) this
button is? On different sheets, the buttons may be at Row
10, 20, 30... for example.

I would like my macro code to determine where the button
is and delete only the CurrentRegion.

Thank you so much for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default The cell address of a button?

Depends on what type of button.

If from the forms toolbar, then application.Caller will return the name of
the button and you can use

msgbox Activesheet.Buttons(application.Caller).TopLeftCel l.Address

--
Regards,
Tom Ogilvy

" wrote in message
...
I have a worksheet with data from each month arranged in
rows. For example, Rows 1-5 have January data, row 6 is
blank, Rows 7-12 have February data, etc.

In the first row of each month's data (in Column E), I
have a button that allows the user to erase the data only
for the month associated with the button. Is there any
way to determine where (Row and Column address) this
button is? On different sheets, the buttons may be at Row
10, 20, 30... for example.

I would like my macro code to determine where the button
is and delete only the CurrentRegion.

Thank you so much for your help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default The cell address of a button?

Thanks for your very quick reply.
My button is from the forms toolbar, and this does give
the correct address. How do I make this address into the
ActiveCell?

-----Original Message-----
Depends on what type of button.

If from the forms toolbar, then application.Caller will

return the name of
the button and you can use

msgbox Activesheet.Buttons

(application.Caller).TopLeftCell.Address

--
Regards,
Tom Ogilvy

"

wrote in message
...
I have a worksheet with data from each month arranged in
rows. For example, Rows 1-5 have January data, row 6 is
blank, Rows 7-12 have February data, etc.

In the first row of each month's data (in Column E), I
have a button that allows the user to erase the data

only
for the month associated with the button. Is there any
way to determine where (Row and Column address) this
button is? On different sheets, the buttons may be at

Row
10, 20, 30... for example.

I would like my macro code to determine where the button
is and delete only the CurrentRegion.

Thank you so much for your help.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default The cell address of a button?

Range(ActiveSheet.Buttons(Application.Caller).TopL eftCell.Address).Activate

Doug

wrote in message
...
Thanks for your very quick reply.
My button is from the forms toolbar, and this does give
the correct address. How do I make this address into the
ActiveCell?

-----Original Message-----
Depends on what type of button.

If from the forms toolbar, then application.Caller will

return the name of
the button and you can use

msgbox Activesheet.Buttons

(application.Caller).TopLeftCell.Address

--
Regards,
Tom Ogilvy

"

wrote in message
...
I have a worksheet with data from each month arranged in
rows. For example, Rows 1-5 have January data, row 6 is
blank, Rows 7-12 have February data, etc.

In the first row of each month's data (in Column E), I
have a button that allows the user to erase the data

only
for the month associated with the button. Is there any
way to determine where (Row and Column address) this
button is? On different sheets, the buttons may be at

Row
10, 20, 30... for example.

I would like my macro code to determine where the button
is and delete only the CurrentRegion.

Thank you so much for your help.



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default The cell address of a button?

or do it directly:

ActiveSheet.Buttons(Application.Caller).TopLeftCel l.Activate

--
Regards,
Tom Ogilvy


"Doug Glancy" wrote in message
...

Range(ActiveSheet.Buttons(Application.Caller).TopL eftCell.Address).Activate

Doug

wrote in message
...
Thanks for your very quick reply.
My button is from the forms toolbar, and this does give
the correct address. How do I make this address into the
ActiveCell?

-----Original Message-----
Depends on what type of button.

If from the forms toolbar, then application.Caller will

return the name of
the button and you can use

msgbox Activesheet.Buttons

(application.Caller).TopLeftCell.Address

--
Regards,
Tom Ogilvy

"

wrote in message
...
I have a worksheet with data from each month arranged in
rows. For example, Rows 1-5 have January data, row 6 is
blank, Rows 7-12 have February data, etc.

In the first row of each month's data (in Column E), I
have a button that allows the user to erase the data

only
for the month associated with the button. Is there any
way to determine where (Row and Column address) this
button is? On different sheets, the buttons may be at

Row
10, 20, 30... for example.

I would like my macro code to determine where the button
is and delete only the CurrentRegion.

Thank you so much for your help.


.





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
Global Address List after clicking E-mail button in Excel 2003 elance Excel Discussion (Misc queries) 0 October 8th 09 02:34 PM
=HYPERLINK("#"&CELL("address", ADDRESS(MATCH(VALUE(B3),QuoteNotes, sarah Excel Worksheet Functions 2 February 17th 09 02:59 PM
=HYPERLINK("#"&CELL("address", ADDRESS(MATCH(VALUE(B3),Range ... ? sarah Excel Worksheet Functions 0 February 17th 09 02:06 PM
Return cell address of a cell based on contents of cell. Danny Excel Worksheet Functions 4 November 15th 08 03:11 AM
How do I create a submit button to an email address in excel? farhospurchase Excel Discussion (Misc queries) 1 August 1st 06 08:56 PM


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