Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Without knowing what "does not work" means...
I would guess that you need a keypress event for each textbox. Your code only executes if the keypress occurs over the userform not the textboxes. -- Jim Cone Portland, Oregon USA http://www.mediafire.com/PrimitiveSoftware .. .. .. wrote in message ... Hi Jim, Do you know why the option for Keypress does not work.I updated my code as below: Dim GameNum As Variant If KeyAscii = 49 Then GameNum = Sheet1.Range("game").Value Label10.Caption = GameNum Label1.BackColor = &HFFC0C0 Controls.Item("TextBox" & GameNum) = "T" Sheet1.Range("game") = Sheet1.Range("game") + 1 End If If KeyAscii = 50 Then GameNum = Sheet1.Range("game").Value Label10.Caption = GameNum Label2.BackColor = &HFF& Controls.Item("TextBox" & GameNum) = "O" Sheet1.Range("game") = Sheet1.Range("game") + 1 End If Exit Sub If KeyAscii = 51 Then GameNum = Sheet1.Range("game").Value Label10.Caption = GameNum Label2.BackColor = &HFF& Controls.Item("TextBox" & GameNum) = "O" Sheet1.Range("game") = Sheet1.Range("game") + 1 End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
texbox event update | Excel Programming | |||
How to tab to next from a texbox | Excel Programming | |||
Add texbox to Multipage on worksheet | Excel Programming | |||
use value in texbox to search through worksheet | Excel Discussion (Misc queries) | |||
OLE Object -TexBox Properties | Excel Programming |