PC Review


Reply
Thread Tools Rate Thread

Deselect a Commandbutton

 
 
=?Utf-8?B?am5mNDA=?=
Guest
Posts: n/a
 
      4th Sep 2007
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?
 
Reply With Quote
 
 
 
 
New Member
Join Date: Aug 2007
Posts: 18
 
      4th Sep 2007
Can you post you code and where your code is ? (ie in sheet1 or in module)
I suspect the problems is that you need the sheet active for you code to work
 
Reply With Quote
 
Dave D-C
Guest
Posts: n/a
 
      5th Sep 2007
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 =----
 
Reply With Quote
 
william schneider
Guest
Posts: n/a
 
      31st Aug 2010
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
deselect one of the shapes already Microsoft Excel Programming 4 11th Nov 2008 03:46 PM
ActiveChart.Deselect won't Deselect Mark Stephens Microsoft Excel Charting 2 16th Jun 2005 02:54 AM
deselect sali Microsoft Excel Discussion 2 30th Apr 2005 10:20 PM
Deselect? ianripping Microsoft Excel Programming 2 13th Mar 2004 06:22 PM
Deselect combobox Christian Dokman Microsoft VB .NET 1 26th Nov 2003 07:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:37 PM.