Deselect a Commandbutton

J

jnf40

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?
 
D

Dave D-C

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

william schneider

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top