Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Oskar von dem Hagen" skrev i melding
... (Bullen et al. write "Most VBA users will never have to create their own objects because Excel already provides all of the objects they need." That's why I skipped the chapter on class modules. :-) ) Reading books like that makes you more than "most excel users" ;-) I was surprised not to find a ready solution in the newsgroup. What do other authors do, force people to use the mouse? When you've done this a few times it't pretty quick to set up again. There will always me more scenarios than ready-to-go solutions. My hopefully last problem in this thread is probably trivial but I haven't figured it out yet. Why does the class modul not recognize the subroutine bnNext_Click, containd in the UserForm in the same Project? The class module is NOT in the userform, it is simply a collection of abstract rules of behavior for a userform textbox. This is purist stuff, but still: You have more than one way to call the "Next whatever" action. PgUp, buttonclick and maybe morenow or later. Then do not place the action in the button code, separate it and call it from wherever. Put this in the userform module: Public Sub NextRec() MsgBox "Next" End Sub Public Sub PrevRec() MsgBox "Previous" End Sub and make your button code do this: Private Sub BnNext_Click() NextRec End Sub Private Sub bnPrevious_Click() PrevRec End Sub Now (note the Public in the subs) you can call it also from everywhere as long as you address it. Edit your class code to Private Sub txtbox_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) Select Case KeyCode Case 34 UserForm1.NextRec Case 33 UserForm1.PrevRec Case Else Exit Sub End Select KeyCode = 0 End Sub P.S. I love the "skrev i melding". That's norwegian. So am I :-) HTH. Best wishes Harald |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to use "standard deviation" option in Y error bar menu? | Charts and Charting in Excel | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
In Excel 2003 is there a way to prevent "Save As" and "Print"? | Excel Discussion (Misc queries) | |||
Standard font in a "New Microsoft Excel Worksheet.xls" wont change | Excel Discussion (Misc queries) | |||
Prevent "standard" key event in userform | Excel Programming |