Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
command button add another command | Excel Discussion (Misc queries) | |||
command button | Excel Discussion (Misc queries) | |||
command button | Excel Discussion (Misc queries) | |||
Command Button vs Control Button | Excel Programming | |||
Command Button vs Form Button | Excel Programming |