Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Command Button

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Command Button

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.



"jongdg <" wrote:

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

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Command Button

Could you please supply the code?

--
Rob van Gelder - http://www.vangelder.co.nz/excel


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


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
command button add another command Wanna Learn Excel Discussion (Misc queries) 5 December 7th 08 11:42 PM
command button Zygan Excel Discussion (Misc queries) 0 June 30th 06 01:59 AM
command button Hellboy Excel Discussion (Misc queries) 0 November 3rd 05 02:51 PM
Command Button vs Control Button RGibson Excel Programming 1 October 14th 03 02:24 AM
Command Button vs Form Button T K Excel Programming 4 August 26th 03 07:26 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"