Command Button

  • Thread starter Thread starter jongdg
  • Start date Start date
J

jongdg

This is probably a simple problem. There are certain macro's that
want to assign a command button to. I have no problem if the macr
functions within the sheet that contains the button. But, if the macr
calls for information contained within a different sheet, the macr
fails. The strange part is that these macro run fine if there no
assigned to a command button. But once the same macro code is copie
into the private sub of a command button, it fails
 
Two guesses.

#1. You're using xl97. Try changing the .takefocusonclick to False.
Or add: Activecell.activate (right near the top of your code)

#2. You didn't qualify your ranges.
If it's an unqualified range in a worksheet module, then it refers to the
sheet that owns the code:

behind sheet1:
worksheets("sheet2").select
range("a1").value = 99

that range("a1") refers to sheet1--not the activesheet.
 

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

Similar Threads


Back
Top