Excel 2007 VBA/Vista - How do I deselect a selection programmatica

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have read some suggestions to use:
"Application.CutCopyMode = False"
but am leery of using that because "False" is not a valid value for CutCopy,
only "XLCopy" and "XLCut" are.
 
Thank you, Tom. I thought I needed to deselect to solve my problem, but I
still have my problem even after CutCopy=False.

My real problem is that I want to change the colors of two CommandButtons
immediately. One of my procedures (A), changes one button as desired. The
other(B), is delayed until some other procedures have finished. The main
difference in the two procedures is that the procedure causing the delayed
color change(B), uses an integer on the spreadsheet.

I believe I am using Application.ScreenUpdating properly.

The problem is that both procedures succeed on the second and subsequent
uses. Furthermore, if I follow a double-success with with a single click
anywhere on the spreadsheet, I get one success and the other (the same
procedure B) delayed. Any Ideas?
 
possibly

Code to change the color
Application.ScreenUpdating = false
Application.ScreenUpdating = True
doevents

this might cause the screen to update and solve the problem.
 
Thanks for your help, Tom.
I tried DoEvents, but it transferred control to Vista and Vista did unknown
things before it came back to my procedures. Thanks, anyway. I don't wish
to spend any more time on this minor point. I will just christen the delay
as a "program feature" and forget about 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

Back
Top