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

I am running a macro from a button that inserts a new row and copies the
formulas from the row above into it, but when doing this i need to specify an
active cell at the point at which the new row is inseted. is it possible that
i can insert code that selects the cell the button is on top of?

Thankyou
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default selecting cell under a button

Absolutely. The button is not part of the cell but floating on a layer above
the cell.

Mike F
"Patrick Bateman" wrote in
message ...
I am running a macro from a button that inserts a new row and copies the
formulas from the row above into it, but when doing this i need to specify
an
active cell at the point at which the new row is inseted. is it possible
that
i can insert code that selects the cell the button is on top of?

Thankyou



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default selecting cell under a button

is that absolutely not or absolutely? if it i possible, any idea how?


"Mike Fogleman" wrote:

Absolutely. The button is not part of the cell but floating on a layer above
the cell.

Mike F
"Patrick Bateman" wrote in
message ...
I am running a macro from a button that inserts a new row and copies the
formulas from the row above into it, but when doing this i need to specify
an
active cell at the point at which the new row is inseted. is it possible
that
i can insert code that selects the cell the button is on top of?

Thankyou




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default selecting cell under a button

You are not giving much detail, but if the button is covering cell A10 then
code
Range("A10"). Select
will select the cell.

Mike F
"Patrick Bateman" wrote in
message ...
is that absolutely not or absolutely? if it i possible, any idea how?


"Mike Fogleman" wrote:

Absolutely. The button is not part of the cell but floating on a layer
above
the cell.

Mike F
"Patrick Bateman" wrote in
message ...
I am running a macro from a button that inserts a new row and copies the
formulas from the row above into it, but when doing this i need to
specify
an
active cell at the point at which the new row is inseted. is it
possible
that
i can insert code that selects the cell the button is on top of?

Thankyou






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default selecting cell under a button

Assuming it is a forms button, and it is called myButton, then use

ActiveSheet.Buttons("myButton").TopLeftCell.Entire Row.Insert


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Patrick Bateman" wrote in
message ...
is that absolutely not or absolutely? if it i possible, any idea how?


"Mike Fogleman" wrote:

Absolutely. The button is not part of the cell but floating on a layer
above
the cell.

Mike F
"Patrick Bateman" wrote in
message ...
I am running a macro from a button that inserts a new row and copies the
formulas from the row above into it, but when doing this i need to
specify
an
active cell at the point at which the new row is inseted. is it
possible
that
i can insert code that selects the cell the button is on top of?

Thankyou








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default selecting cell under a button

Bob, assuming i would have to replace "mybutton" with the name of the button
is there a way of the just using the button i have just pressed.

thankyou

"Bob Phillips" wrote:

Assuming it is a forms button, and it is called myButton, then use

ActiveSheet.Buttons("myButton").TopLeftCell.Entire Row.Insert


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Patrick Bateman" wrote in
message ...
is that absolutely not or absolutely? if it i possible, any idea how?


"Mike Fogleman" wrote:

Absolutely. The button is not part of the cell but floating on a layer
above
the cell.

Mike F
"Patrick Bateman" wrote in
message ...
I am running a macro from a button that inserts a new row and copies the
formulas from the row above into it, but when doing this i need to
specify
an
active cell at the point at which the new row is inseted. is it
possible
that
i can insert code that selects the cell the button is on top of?

Thankyou






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default selecting cell under a button

If you mean in the macro assigned to the button(s)

s = Application.Caller
ActiveSheet.Buttons(s).TopLeftCell.EntireRow.Inser t

--
Regards,
Tom Ogilvy


"Patrick Bateman" wrote:

Bob, assuming i would have to replace "mybutton" with the name of the button
is there a way of the just using the button i have just pressed.

thankyou

"Bob Phillips" wrote:

Assuming it is a forms button, and it is called myButton, then use

ActiveSheet.Buttons("myButton").TopLeftCell.Entire Row.Insert


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Patrick Bateman" wrote in
message ...
is that absolutely not or absolutely? if it i possible, any idea how?


"Mike Fogleman" wrote:

Absolutely. The button is not part of the cell but floating on a layer
above
the cell.

Mike F
"Patrick Bateman" wrote in
message ...
I am running a macro from a button that inserts a new row and copies the
formulas from the row above into it, but when doing this i need to
specify
an
active cell at the point at which the new row is inseted. is it
possible
that
i can insert code that selects the cell the button is on top of?

Thankyou






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default selecting cell under a button

Thats done it Tom, thank you all for your help

"Tom Ogilvy" wrote:

If you mean in the macro assigned to the button(s)

s = Application.Caller
ActiveSheet.Buttons(s).TopLeftCell.EntireRow.Inser t

--
Regards,
Tom Ogilvy


"Patrick Bateman" wrote:

Bob, assuming i would have to replace "mybutton" with the name of the button
is there a way of the just using the button i have just pressed.

thankyou

"Bob Phillips" wrote:

Assuming it is a forms button, and it is called myButton, then use

ActiveSheet.Buttons("myButton").TopLeftCell.Entire Row.Insert


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Patrick Bateman" wrote in
message ...
is that absolutely not or absolutely? if it i possible, any idea how?


"Mike Fogleman" wrote:

Absolutely. The button is not part of the cell but floating on a layer
above
the cell.

Mike F
"Patrick Bateman" wrote in
message ...
I am running a macro from a button that inserts a new row and copies the
formulas from the row above into it, but when doing this i need to
specify
an
active cell at the point at which the new row is inseted. is it
possible
that
i can insert code that selects the cell the button is on top of?

Thankyou






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
Transfer cell values to another cell by selecting button. Gryndar Excel Worksheet Functions 2 November 24th 08 02:21 AM
Selecting a row relative to the position of a button HHall Excel Programming 2 October 14th 05 01:00 AM
Selecting Button Just Activated (help!) jpizzle[_3_] Excel Programming 8 June 6th 05 02:35 PM
selecting more than one option button Katie-Baughman Excel Discussion (Misc queries) 4 May 6th 05 02:24 PM
Tab selecting a button with assigned macro ob3ron02[_18_] Excel Programming 0 November 2nd 04 06:18 PM


All times are GMT +1. The time now is 02:00 PM.

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"