ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deselect a Commandbutton (https://www.excelbanter.com/excel-programming/396845-deselect-commandbutton.html)

jnf40

Deselect a Commandbutton
 
I have two Optionbuttons on a worksheet when you click one it enables certain
commandbuttons on the same sheet and changes the interior color and locks
certain cells, then you click another commandbutton and it runs a macro
creating a new sheet. After the new sheet is created you can then click on a
command button on the new sheet and it will bring you back to the first
sheet. When I click on the second optionbutton, it is supposed to disable the
commandbuttons that were enabled, then change the interior color and unlock
the cells that were locked, however it will not release the last
commandbutton it disables and select the cell that I have told it to. I get
an error message that says 'Object doesn't support this property or method'.
When I look at the sheet the last commandbutton is still selected. If I
manually select the cell then click continue the macro finishes. Any
suggestions?

Dave D-C[_3_]

Deselect a Commandbutton
 
D-C writes:
How about selecting something else to deselect the Button?
E.g. cells(1,1).select

jnf40 wrote:
I have two Optionbuttons on a worksheet when you click one it enables certain
commandbuttons on the same sheet and changes the interior color and locks
certain cells, then you click another commandbutton and it runs a macro
creating a new sheet. After the new sheet is created you can then click on a
command button on the new sheet and it will bring you back to the first
sheet. When I click on the second optionbutton, it is supposed to disable the
commandbuttons that were enabled, then change the interior color and unlock
the cells that were locked, however it will not release the last
commandbutton it disables and select the cell that I have told it to. I get
an error message that says 'Object doesn't support this property or method'.
When I look at the sheet the last commandbutton is still selected. If I
manually select the cell then click continue the macro finishes. Any
suggestions?



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

william schneider

Deselect a command button
 
it doesn't work, even if i write code like:

cells(1,1).select

VB will say 'Select method or range class failed'

if i try to assign a value to a cell:

cells(1,1).value=1

VB will say 'Object Doesn't support this property or method'

i believe the 'selection' is still on the command button which makes any property or method doesn't work

does any one know how to solve it?

On Tuesday, September 04, 2007 1:56 PM jnf4 wrote:


I have two Optionbuttons on a worksheet when you click one it enables certain
commandbuttons on the same sheet and changes the interior color and locks
certain cells, then you click another commandbutton and it runs a macro
creating a new sheet. After the new sheet is created you can then click on a
command button on the new sheet and it will bring you back to the first
sheet. When I click on the second optionbutton, it is supposed to disable the
commandbuttons that were enabled, then change the interior color and unlock
the cells that were locked, however it will not release the last
commandbutton it disables and select the cell that I have told it to. I get
an error message that says 'Object doesn't support this property or method'.
When I look at the sheet the last commandbutton is still selected. If I
manually select the cell then click continue the macro finishes. Any
suggestions?



On Wednesday, September 05, 2007 3:42 PM Dave D-C wrote:


D-C writes:
How about selecting something else to deselect the Button?
E.g. cells(1,1).select

jnf40 wrote:


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----



Submitted via EggHeadCafe - Software Developer Portal of Choice
BizTalk: Parallel Processing with Correlation
http://www.eggheadcafe.com/tutorials...rrelation.aspx



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com