ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

µJÂI¤Î±±¨îÅv°ÝÃD

µJÂI¤Î±±¨îÅv°ÝÃD

¥»©«³Ì«á¥Ñ reangame ©ó 2023-4-19 23:21 ½s¿è
  1. Private Sub CommandButton1_Click()
  2. ActiveCell.Value = "¡¶"
  3. ActiveCell.Offset(0, 1).Select
  4. ThisWorkbook.ActiveSheet.Activate ' ±N±±¨îÅvÂಾ¨ì¥Ø«e¤u§@ªí
  5. End Sub
½Æ»s¥N½X
½Ð°Ý§Ú¦b¤u§@ªí¤¤«Ø¥ß¤@­Ó«ö¶s1¡A©I¥sªí³æ¡A
µM«áªí³æ¤W«Ø¥ß«ö¶s2(¤W¤è¬°µ{¦¡½X)¡A
¦b¤u§@ªí·í«eÀx¦s®æ´¡¤J¤å¦r«á¡A¿ï¨ú¥kÃäÀx¦s®æ¡A°õ¦æ³£¥¿½T¡A
¦ý¬O¡Aµ²§ô¤§«á¡AµLªkª½±µ¨Ï¥ÎÁä½L¦b¤u§@ªí¿é¤J¸ê®Æ¡A
ÂIÀ»¤è¦VÁä¡Aµo²{ªí³æ¤Wªº«ö¶s¦b¤Á´«¿ï¨úª¬ºA¡A
¸Ó¦p¦ó¼¶¼gµ{¦¡½X¡AÂIÀ»«ö¶s2§¹¦¨°Ê§@¤§«á¡A¥i¥Hª½±µ¨Ï¥ÎÁä½L¦b¤u§@ªí¿é¤J¸ê®Æ©O?
  1. Private Sub UserForm_Activate()
  2. Dim ctrl As Control
  3. For Each ctrl In Me.Controls
  4. If TypeName(ctrl) = "CommandButton" Then
  5. ctrl.TabStop = False
  6. End If
  7. Next ctrl
  8. End Sub
½Æ»s¥N½X
TabStopÄÝ©Ê+DefaultÄݩʧ¡¤w³]©w¬°false
  1. Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  2. If KeyCode = vbKeyTab Then
  3. Application.SendKeys "{TAB}"
  4. KeyCode = 0
  5. End If
  6. End Sub
½Æ»s¥N½X
³o¬Ochatgptµ¹ªº¸Ñªk¡A¤´µMµLªk¸Ñ¨M
  1. Sub showUF1()
  2.     UserForm1.Show modeless
  3. End Sub
½Æ»s¥N½X
³o¬O«ö¶s1ªºµ{¦¡½X
§Ú¬O´µ¦h

½Ð°Ý¦U¦ì¤j¤j¡A³o¬OµL¸Ñªº°ÝÃD¶Ü?
§Ú¬O´µ¦h

TOP

¥»©«³Ì«á¥Ñ singo1232001 ©ó 2023-7-24 02:19 ½s¿è

¦^´_ 2# reangame

Public actRng
Private Sub CommandButton1_Click()
actRng.Value = "¡¶"
'actRng.Offset(0, 1).Select
'ThisWorkbook.ActiveSheet.Activate ' ±N±±¨îÅvÂಾ¨ì¥Ø«e¤u§@ªí

unload me
'©ÎªÌ¥i¥H¸Õ¸Õ¬ÝUserForm1. Hide
End Sub


Private Sub UserForm_Activate()
Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeName(ctrl) = "CommandButton" Then
ctrl.TabStop = False
End If
Next ctrl
End Sub

Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyTab Then
Application.SendKeys "{TAB}"
KeyCode = 0
End If
End Sub
½Æ»s¥N½X

Sub showUF1()
    set actRng = ActiveCell
    UserForm1.Show 0 'modeless
End Sub

TOP

        ÀR«ä¦Û¦b : ¯àµ½¥Î®É¶¡ªº¤H¡A¥²¯à´x´¤¦Û¤v§V¤Oªº¤è¦V¡C
ªð¦^¦Cªí ¤W¤@¥DÃD