Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"scottnshelly " wrote in
message ... I have a very uncomplicated code that is giving me troubles. i have been trying to figure this out for much longer than i want to admit. here is the code. Private Sub CommandButton2_Click() it is giving me the following error: Run-time error '1004': Select method of range class failed when i go to debug it highlights line 14 - range("ah7").select. i have tried moving this line, and changing it. any suggestions? It sounds like the button that your code is attached to still has focus. Try changing the TakeFocusOnClick property of the button to False. This should prevent the error from occurring. FWIW, it looks like there are several lines of code that could be removed safely. Most of the stuff that we need to do with code can be done without changing the selection and referring to ActiveSheet/ActiveCell. Doing so will improve performance and make the code easier to maintain. Hope this helps, -Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select used range | Excel Worksheet Functions | |||
How can change range to select active rows instead of :=Range("S10 | Excel Discussion (Misc queries) | |||
When entering data into a range of cells, select the entire range. | Excel Discussion (Misc queries) | |||
Select a range | Excel Discussion (Misc queries) | |||
I cannot select a range | Excel Discussion (Misc queries) |