±³À°°úÁ¤ ³ªÀÇÇнÀ ¿ÀÇǽºÆÁ °Ë»ö ¹«·á°­ÁÂ
Home ·Î±×ÀΠȸ¿ø°¡ÀÔ °í°´¼¾ÅÍ »çÀÌÆ®¸Ê
¿ÀÇǽºÆ©ÅÍ ±â¾÷ASP¼­ºñ½º > ¹«·á°­ÁÂ
¿¢¼¿ 2000 µû¶óÇϱâ
Ȩ·¯´× ¿¢¼¿ 2000°­ÁÂ
À繫 ÇÔ¼ö °­ÁÂ
¿¢¼¿ 2002 »õ·Î¿î ±â´É
Ȳ±â¼º´ÔÀÇ VBA°­ÁÂ
°û½ÂÁÖ´ÔÀÇ VBAÀ̾߱â
Home > ¹«·á°­Á > ¿¢¼¿
¿¢¼¿, °û½ÂÁÖ´ÔÀÇ ¿ÀÆ©°ø±¸ÇÔ Á¦ÀÛÀ¸·Î ¹è¿öº¸´Â VBA À̾߱â, Excel

2. µµ±¸ ¸ðÀ½ ¸¸µé±â-¥±

ÀÌÁ¦ºÎÅÍ´Â Äڵ带 ÇϳªÇϳª ¶â¾îº¸°Ú½À´Ï´Ù.

Const USER_TAG As String = "UserToolbar"
Const CBO_TAG As String = "UserCombo"
Const TOOL_NAME As String = "¿ÀÆ©°ø±¸ÇÔ"

"_TAG"·Î ³¡³ª´Â »ó¼ö´Â °³Ã¼¸¦ ½Äº°Çϱâ À§ÇÑ °ÍÀÔ´Ï´Ù. Áö³­ ¸Þ´º¿¡¼­µµ º¸¾ÒÀ» °Ì´Ï´Ù.

TOOL_NAME »ó¼ö´Â µµ±¸¸ðÀ½ÀÇ À̸§ÀÔ´Ï´Ù. ÀÌ À̸§Àº [º¸±â(V)]-[µµ±¸¸ðÀ½(T)] À» Ŭ¸¯Çϰųª ¸Þ´º¿Í µµ±¸Ç¥½ÃÁÙÀÇ ºó°÷¿¡¼­ ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°À» Ŭ¸¯ÇÏ¸é º¼ ¼ö ÀÖ½À´Ï´Ù.
¡¡

¡¡

¡¡

¡¡

Sub CreateUserToolbar()
     Dim cmdbarUser As CommandBar
µµ±¸¸ðÀ½À» ¸¸µé±â À§ÇÑ CommandBar°³Ã¼¸¦ ¼±¾ðÇÕ´Ï´Ù.

     On Error GoTo ErrHandler
¿¡·¯ Çڵ鷯ÀÔ´Ï´Ù. ºÒÀÇÀÇ ¿¡·¯¸¦ ¹Þ°Ô µÇ¸é "ErrHandler"¶ó°í LabelÀ» ºÙÀÎ °÷À¸·Î À̵¿Ç϶ó´Â ÀǹÌÀÔ´Ï´Ù. ÇÁ·Î±×·¥ÀÇ ÀÛ¼º¿¡¼­ ¿¡·¯¿¡ ´ëÇÑ Ã³Ä¡´Â Áß¿äÇÕ´Ï´Ù. 99% ¿Ï¼ºÈÄ ³ª¸ÓÁö 1%¸¦ ä¿ìÁö ¸øÇØ ¹Ì¿ÏÀ¸·Î ³²´Â °æ¿ì°¡ ¸¹½À´Ï´Ù. ÀÌ 1%°¡ ¹ö±×°¡ ¾ø´Â ÇÁ·Î±×·¥À» ¸¸µå´Â °ÍÀÌ°í À̸¦ À§Çؼ­´Â ¿¡·¯Çڵ鷯¸¦ ¸¸µé¾î µÎ¼Å¾ß ÇÕ´Ï´Ù. VBA¿¡¼­´Â ¿¡·¯Ã³Ä¡¸¦ À§ÇÑ ¿©·¯ ¹æ¹ýÀ» ÁغñÇÏ°í Àִµ¥ On Error°ú °ü·ÃÇÑ ±¸¹®Àº ´ÙÀ½°ú °°½À´Ï´Ù.

  • On Error GoTo line or label Á¦°¡ À§¿¡¼­ »ç¿ëÇÑ ±¸¹®ÀÔ´Ï´Ù.
  • On Error Resume Next ¿¡·¯°¡ ³­ ¹®ÀåÀÇ ´ÙÀ½ºÎÅÍ ½ÃÀÛÇ϶ó´Â ÀǹÌÀÔ´Ï´Ù.
  • On Error GoTo 0 ¸ðµç ¿¡·¯Çڵ鷯¸¦ »ç¿ë¸øÇϵµ·Ï ÇÕ´Ï´Ù.

     Set cmdbarUser = Application.CommandBars.Add(Name:=TOOL_NAME,
     Position:=msoBarTop)

Áß¿äÇÑ ºÎºÐÀÔ´Ï´Ù. ¾Õ¼­ ¼±¾ðÇÑ CommandBar°³Ã¼º¯¼ö¿¡ »õ·Î¿î °³Ã¼¸¦ Ãß°¡ÇÏ°í ÀÖ½À´Ï´Ù. À̸§Àº »ó¼ö·Î ÀÌ¹Ì ¸¸µç °ÍÀ» ºÎ¿©ÇÏ°í À§Ä¡´Â µµ±¸¸ðÀ½µéÀÌ ÀÚÁÖ ¸ðÀÌ´Â °÷(?) ÀÎ ¸Þ´º¹ØÀÇ È­¸é»ó´ÜÀ¸·Î Á¤Çß½À´Ï´Ù. À§¿¡¼­ º¸¸é CommandBars´Â CommandBar °¡ ¿©·µ ¸ðÀÎ °³Ã¼Ä÷¼ÇÀÔ´Ï´Ù. µû¶ó¼­ CommandBars°³Ã¼ÀÇ Add¸Þ¼Òµå¸¦ »ç¿ëÇÑ´Ù´Â °ÍÀº CommandBar¸¦ Çϳª ´õ Ãß°¡ÇÏ°Ú´Ù´Â ÀǹÌÀÔ´Ï´Ù. ÀÌ¿Í ºñ½ÁÇÑ °æ¿ì°¡ ¾Æ·¡¿¡µµ ´õ ÀÖ½À´Ï´Ù.

     CreateUserButton cmdbarUser
     CreateUserCombo cmdbarUser
µµ±¸¸ðÀ½¿¡ ¹öÆ°°ú ÄÞº¸»óÀÚ¸¦ ¸¸µå´Â ÇÁ·Î½ÃÁ®¸¦ ½ÇÇàÇÕ´Ï´Ù.

     cmdbarUser.Visible = True

               <¿Ï¼ºµÈ ¿ÀÆ© °ø±¸ÇÔ>

°£´ÜÇÏÁö¸¸ "¿ÀÆ©°ø±¸ÇÔ" À̶ó´Â µµ±¸¸ðÀ½ÀÌ »ý°å½À´Ï´Ù. ±×·¯³ª ±×°Ç ¾îµð±îÁö³ª ³»ºÎÀûÀ¸·ÎÀÔ´Ï´Ù. ½ÇÁ¦·Î È­¸é¿¡ º¸ÀÌ°Ô ÇÏ·Á¸é À§¿¡¼­ ó·³ VIsible¼Ó¼º¸¦ TRUE·Î º¯°æÇØÁÖ¾î¾ß ÇÕ´Ï´Ù.

     Set cmdbarUser = Nothing
ÀÌÁ¦ »ç¿ëÇÑ °³Ã¼º¯¼ö¸¦ ¸Þ¸ð¸®¿¡¼­ Ç®¾î ÁÝ´Ï´Ù.

     Exit Sub
ÀÌ´Â ¿¡·¯Çڵ鷯¿Í °ü·ÃÇÑ °ÍÀÔ´Ï´Ù. ±× Àǹ̴ ÇöÀçÀÇ SubÇÁ·Î½ÃÁ®¸¦ ºüÁ® ³ª¿À¶ó´Â ÀǹÌÀÔ´Ï´Ù. ¸¸ÀÏ ÀÌ ¹®ÀåÀÌ ¾ø´Ù¸é ¾Æ·¡ÀÇ ¿¡·¯Çڵ鷯±îÁö ½ÇÇàµÉ °Ì´Ï´Ù. ±×·¯¹Ç·Î ¿¡·¯Çڵ鷯¸¦ »ç¿ëÇÏ°Ô µÇ¸é Exit Sub¹®À» »ç¿ëÇÕ´Ï´Ù. ±×·¯³ª Function ÇÁ·Î½ÃÁ®¶ó¸é Exit FunctionÀ» »ç¿ëÇÕ´Ï´Ù.

ErrHandler:
LabelÀ̶ó´Â °ÍÀÔ´Ï´Ù. Å« Àǹ̴ ¾ø°í ÇÁ·Î±×·¥ÀÇ È帧À» ¹Ù²Ù´Â °æ¿ì¿¡ ÀÌ¿ëµË´Ï´Ù.

     DeleteUserToolbar
"¿ÀÆ©°ø±¸ÇÔ" µµ±¸¸ðÀ½À» »èÁ¦ÇÏ´Â ÇÁ·Î½ÃÁ®¸¦ »ìÇàÇÕ´Ï´Ù.

     Resume
¿¡·¯°¡ ¹ß»ýÇÑ °÷ºÎÅÍ ´Ù½Ã ½ÃÀÛÇ϶ó´Â ÀǹÌÀÔ´Ï´Ù. ResumeÀº ¼¼°³ÀÇ À¯ÇüÀ¸·Î »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.

  • Resume ¿¡·¯°¡ °£ °÷¿¡¼­ ´Ù½Ã ½ÃÀÛÇ϶ó´Â ÀǹÌ
  • Resume Next ¿¡·¯°¡ ³­ ´ÙÀ½ ¹®ÀåºÎÅÍ ½ÃÀÛÇ϶ó´Â ÀǹÌ
  • Resume line or label label·Î À̵¿ÇÏ¿© ´Ù½Ã ½ÃÀÛÇ϶ó´Â ÀǹÌ

 À§¿¡¼­ Á¦°¡ ¿¡·¯Çڵ鷯¸¦ ´Þ¾Æ µÐ ÀÌÀ¯´Â, °¡·É Sub CreateUserToolbar()°¡ ÀÌ¹Ì ½ÇÇàÇÑ »óÅ¿¡¼­ ½Ç¼öµîÀ¸·Î ´Ù½Ã Çѹø ½ÇÇàÇÏ´Â °æ¿ì¸¦ ´ëºñÇϱâ À§ÇÑ °ÍÀÔ´Ï´Ù. µû¶ó¼­ µµ±¸¸ðÀ½À» Áö¿ì°í ´Ù½Ã ½ÃÀÛÇϵµ·Ï ÇÏ¿´½À´Ï´Ù.
End Sub
À̹ø¿¡ µµ±¸¸ðÀ½À» »èÁ¦ÇÏ´Â ÇÁ·Î½ÃÁ®¸¦ »ìÆ캸ÁÒ
Sub DeleteUserToolbar()
     Dim cmdbarUser As CommandBar

     On Error GoTo ErrHandler

     Set cmdbarUser = Application.CommandBars(TOOL_NAME)
"¿ÀÆ©°ø±¸ÇÔ" µµ±¸¸ðÀ½ÀÇ °³Ã¼¸¦ ¹Þ¾Æ cmdbarUser¿¡ ÇÒ´çÇÑ´Ù.

     cmdbarUser.Delete
¹ÞÀÚ¸¶ÀÚ ¾ø¾Ö¹ö¸³´Ï´Ù.
     Set cmdbarUser = Nothing
     Exit Sub

ErrHandler:
     Exit Sub
End Sub
Å©°Ô ¼³¸íÇÒ °Ô ¾ø±º¿ä. ÀÌ¹Ì ¾Õ¿¡¼­ ´ÙÇß´ø ºÎºÐÀÌ¶ó ¼³¸íÀº »ý·«ÇÕ´Ï´Ù.
À̹ø¿¡´Â µµ±¸¸ðÀ½¿¡ ¿©·¯ ¹öÆ°À» ºÙÀÌ´Â ÇÁ·Î½ÃÁ®¸¦ ¼³¸íÇÏ°Ú½À´Ï´Ù.
Sub CreateUserButton(cmdbarUser As CommandBar)
ÇÁ·Î½ÃÁ®ÀÇ ¸Å°³º¯¼ö·Î CommandBar°³Ã¼¸¦ ¹Þ½À´Ï´Ù. ÀÌ °³Ã¼´Â "¿ÀÆ©°ø±¸ÇÔ"À» ´ë½ÅÇÏ´Â °³Ã¼º¯¼ö·Î ¿©±â¿¡ ¹öÆ°À» Ãß°¡ÇÏ°Ô µË´Ï´Ù. ±×·¡¼­ ÀÌ ÇÁ·Î½ÃÁ®¸¦ È£ÃâÇÏ´Â °æ¿ì¿£ ´ÙÀ½°ú °°ÀÌ CommandBar°³Ã¼º¯¼ö¸¦ ³Ñ°ÜÁÝ´Ï´Ù.
        CreateUserButton cmdbarUser
        CreateUserCombo cmdbarUser

     Dim i As Byte
     Dim cmdctlUser As CommandBarButton
cmdctlUser°³Ã¼´Â CommandBarButton°³Ã¼º¯¼ö·Î¼­ CommandBarButton°³Ã¼º¯¼ö´Â µµ±¸¸ðÀ½ÀÇ ¹öÆ°À» ÀǹÌÇÕ´Ï´Ù.

     Dim NameFaceIDMacroOfCmdBtn
Áö³­ °­ÀÇ¿¡¼­ ¸Þ´º¸¦ »ý¼ºÇϱâ À§ÇØ ÇÊ¿äÇÑ µ¥ÀÌÅ͸¦ ¿öÅ©½ÃÆ®¿¡ ÀúÀåÇÏ°í ºÒ·¯µé¿´½À´Ï´Ù. À̹ø¿¡ ¿öÅ©½ÃÆ®°¡ ¾Æ´Ï¶ó Array()ÇÔ¼ö¸¦ »ç¿ëÇÏ¿© ¸Þ¸ð¸®¿¡ ÀûÀçÇÑ ÈÄ ÀÐ¾î µéÀÌ´Â ¹æ½ÄÀ¸·Î ¹öÆ°À» ¸¸µé·Á°í ÇÕ´Ï´Ù. ±×·¡¼­ À̸¦ ´ã±â À§ÇÑ NameFaceIDMacroOfCmdBtn º¯¼ö¸¦ ¼±¾ðÇß½À´Ï´Ù.

     NameFaceIDMacroOfCmdBtn = Array( _
     "otHELP", 49, "sbShowHelp", False, _
     "otABOUT", 625, "sbShowAbout", True, _
     "otEXIT", 358, "sbExit", True _
     )

Array()ÇÔ¼ö´Â Variant Çü½ÄÀÇ º¯¼ö¿¡ À§¿Í °°ÀÌ ¹è¿­À» ¸¸µé¾î ÁÝ´Ï´Ù. À̹迭Àº 1Â÷¿ø¹è¿­ÀÔ´Ï´Ù. ´Ù¸¸ ¹è¿­ÀÇ ÀԷ¼ø¼­¸¦ ÁÖÀÇÇؼ­ º¸½Ã±æ ¹Ù¶ø´Ï´Ù. ¸ÕÀú ¹öÆ°ÀÇ À̸§(È­¸é¿¡¼­´Â ÅøÆÁÀ¸·Î ³ª¿À´Â °ÍÀÓ)À» ÀÔ·ÂÇÏ°í ±×´ÙÀ½¿£ FaceID, ¹öÆ°À» Ŭ¸¯ÇÏ´Â °æ¿ì ½ÇÇàÇÒ ÇÁ·Î½ÃÁ®À̸§, ±×·ì¿©ºÎµîÀ» ÀÔ·ÂÇÑ´Ï´Ù.

     For i = LBound(NameFaceIDMacroOfCmdBtn) To
           Bound(NameFaceIDMacroOfCmdBtn) Step 4
¹è¿­À» ´Ù·ç´Ù º¸¸é LBound()¿Í UBound()ÇÔ¼ö¸¦ ÀÚÁÖ »ç¿ëÇÕ´Ï´Ù. ¹è¿­À» »ç¿ëÇغ» ºÐµéÀº ¾Æ½ÇÅ×Áö¸¸ VB/VBA¿¡¼­´Â 0ºÎÅÍ ¹è¿­ÀÇ À妽º°¡ ½ÃÀ۵˴ϴÙ. °¡·É 10°³ÀÇ ¹è¿­À» Dim OneArray(10)ó·³ ¼±¾ðÇϸé 0ºÎÅÍ ½ÃÀÛÇÏ¿© 10±îÁö 11°³ÀÇ º¯¼ö·Î ÀÌ·ç¾îÁø ¹è¿­ÀÌ ¸¸µé¾î Áý´Ï´Ù. ¹°·Ð Option Base1À» ÄÚµùÀÇ Ã³À½ºÎºÐ¿¡ µÎ¸é 1ºÎÅÍ ½ÃÀÛÇÕ´Ï´Ù. BASICÀÇ ¹è¿­¼±¾ðÀº ¸¹ÀÌ ¼¼·ÃµÇ¾îÁ³½À´Ï´Ù. PASCALó·³ Dim OneArray(1 To 10) ó·³ ¼±¾ðÇÒ ¼ö Àִµ¥, ¹è¿­ÀÇ »óÇÏ Â÷¿øÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. LBound()¿Í UBound()´Â ¹è¿­ÀÇ ÇÏÀ§ À妽º¿Í »óÀ§ ÀÎÅؽº¸¦ µ¹·ÁÁÝ´Ï´Ù.

     Set cmdctlUser = cmdbarUser.Controls.Add(Type:=msoControlButton,
        before:=1)

À̹ø¿¡ cmdctlUserº¯¼ö¿¡ µµ±¸¸ðÀ½ÀÇ ¹öÆ°ÄÜÆ®·ÑÀ» Ãß°¡ÇÕ´Ï´Ù. ±×¸®°í ±×À§Ä¡´Â 1¹øÀ¸·Î µÓ´Ï´Ù.

     With cmdctlUser
        .Caption = NameFaceIDMacroOfCmdBtn(i)

NameFaceIDMacroOfCmdBtn()¹è¿­ÀÇ Ã¹¿ä¼Ò´Â ¹öÆ°ÀÇ À̸§À̶ó°í Á¤ÀÇÇß½À´Ï´Ù. ±×·¡¼­ Caption¼Ó¼º¿¡ À̸¦ ÇÒ´çÇÕ´Ï´Ù.

        .FaceId = NameFaceIDMacroOfCmdBtn(i + 1)
FaceID¼Ó¼º¿¡ NameFaceIDMacroOfCmdBtn()¹è¿­ÀÇ en ¹ø° ¿ä¼Ò¸¦ ÇÒ´çÇÕ´Ï´Ù.
        .OnAction = NameFaceIDMacroOfCmdBtn(i + 2)
À̹ø¿¡´Â ¹öÆ°À» Ŭ¸¯ÇÒ °æ¿ì ½ÇÇàÇÒ ÇÁ·Î½ÃÀú¸¦ ÁöÁ¤ÇÕ´Ï´Ù.
        If NameFaceIDMacroOfCmdBtn(i + 3) Then .BeginGroup = True
¿©±â¿¡¼± ±×·ìÀ» ÁöÁ¤ÇÏ´Â ¿©ºÎ¸¦ °áÁ¤ÇÕ´Ï´Ù. »ç½Ç NameFaceIDMacroOfCmdBtn()¹è¿­¿¡ ±×·ìÀº TRUE/FALSE·Î ÁöÁ¤ÇϹǷΠ±»ÀÌ If¹®À» »ç¿ëÇÒ ÇÊ¿ä´Â ¾ø½À´Ï´Ù.
.BeginGroup=NameFaceIDOfCmdBtn(I+3) À¸·Î ÇÏ¸é µË´Ï´Ù.

      End With
    Next i
    Set cmdctlUser = Nothing
End Sub

À̹ø¿¡ º¸°ÔµÉ ÇÁ·Î½ÃÁ®´Â µµ±¸¸ðÀ½¿¡ ÄÞº¸»óÀÚ¸¦ ¸¸µå´Â °ÍÀÔ´Ï´Ù. [¼­½Äµµ±¸¸ðÀ½]À» º¸¸é ±Û²Ã°ú Å©±â¸¦ ÄÞº¸»óÀÚ¸¦ ÀÌ¿ëÇÏ¿© ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù. ´ÙÀ½ÀÇ °Íµµ ±×·± ÄÞº¸¹Ú½ºÀÔ´Ï´Ù.

Sub CreateUserCombo(cmdbarUser As CommandBar)
     Dim cmdctlUser As CommandBarComboBox
ÄÞº¸»óÀÚ¸¦ ´ëÇ¥ÇÏ´Â º¯¼ö¸¦ CommandBarComboBox µ¥ÀÌÅÍÇüÀ¸·Î ¼±¾ðÇß½À´Ï´Ù.

     Set cmdctlUser = cmdbarUser.Controls.Add(Type:=msoControlComboBox,
        Id:=1, before:=1)
»õ·Î¿î ÄÞº¸¹Ú½º°³Ã¼¸¦ Ãß°¡ÇÏ¿© cmdctlUser °Ôüº¯¼ö¿¡ ÇÒ´çÇÕ´Ï´Ù.

     With cmdctlUser
        .Caption = "Date-Format Selector"
        .OnAction = "cmdcboUserAction"
        .BeginGroup = True
        .AddItem Text:="Select any Date-Format"
       .AddItem Text:="YYYY-MM-DD"
       .AddItem Text:="YY-MM-DD"
       .AddItem Text:="YY.MM.DD"

ÄÞº¸¹Ú½º¿¡¼­ ¼±ÅÃÇÒ ¿ä¼Ò¸¦ ÀÔ·ÂÇÕ´Ï´Ù.
        .Width = 150
ÄÞº¸¹Ú½ºÀÇ Å©±â¸¦ ÁöÁ¤ÇÕ´Ï´Ù
        .ListIndex = 1
ÄÞº¸¹Ú½º¿¡¼­ óÀ½ º¸ÀÌ´Â Ç׸ñÀ» ÁöÁ¤ÇÕ´Ï´Ù. ù¹ø¤Š Ç׸ñÀ» ÁöÁ¤ÇÏ°í ÀÕÀ¸¹Ç·Î ½ÇÇàÇϸé "Select any Date-Format" ¶ó´Â ¹®±¸°¡ º¸ÀÏ °ÍÀÔ´Ï´Ù.
        .Tag = CBO_TAG
     End With
     Set cmdctlUser = Nothing
End Sub

¿©±â´Â À§ÀÇ ÄÞº¸¹Ú½º¿Í ¿¬°áµÇ´Â ÇÁ·Î½ÃÁ®·Î¼­ ÄÞº¸¹Ú½º¼±Åÿ¡ µû¶ó ¹«¾ð°¡¸¦ º¸¿©ÁÖµµ·Ï ÇÏ¿´½À´Ï´Ù. ¹°·Ð ÀÌ ÇÁ·Î½ÃÁ®´Â ¿¬½ÀÀ¸·Î ¸¸µé¾î º» °ÍÀε¥ ½ÇÁ¦·Î ÇÏ´Â °æ¿ì¿¡´Â ¼±Åó»¿ë¿¡ µû¶ó ¿©±â¼­ ´Ù½Ã ´Ù¸¥ ÇÁ·Î½ÃÁ®¸¦ È£ÃâÇØ¾ß ÇÒ °ÍÀÔ´Ï´Ù.

Sub cmdcboUserAction()
     Dim cmdctlUser As CommandBarComboBox

     Set cmdctlUser = Application.CommandBars(TOOL_NAME) _
        .FindControl(Type:=msoControlComboBox, Tag:=CBO_TAG)
À§¿¡¼­ ¼³¸íÀ» »ý·«ÇßÁö¸¸ »ç¿ëÀÚÁ¤ÀÇ ÄÞº¸»óÀÚ¿¡ ºÙÀÎ CBO_TAG¶ó´Â ²¿¸®Ç¥¸¦ ã¾Æ °³Ã¼¸¦ µ¹·ÁÁÝ´Ï´Ù. ÀÌ°É º¸´Ï °øÇ׿¡¼­ µµÂøÈÄ ²¿¸®Ç¥¸¦ º¸°í ¼öÇϹ°À» ã´ø »ý°¢ÀÌ ³ª´Â±º¿ä. ±×·¯°í º¸¸é ÇÁ·Î±×·¡¹ÖÀÇ ¼¼°è´Â ½ÇÁ¦ ¼¼°è¿Í ¸¹ÀÌ ´àÀº µíÇÕ´Ï´Ù.

     MsgBox "You Selected! " & vbCrLf & cmdctlUser.Text, vbInformation
¼±ÅÃÇÑ ³»¿ëÀ» ¸Þ½ÃÁö¹Ú½º¸¦ ÅëÇØ º¸¿©ÁÝ´Ï´Ù. À§¿¡¼­µµ ¾ð±ÞÇßÁö¸¸ À§ÀÇ ¹®ÀåÀº ¹«¾ó ¼±ÅÃÇ޴°¡¸¦ º¸¿©ÁÖ·Á´Â ¿¹ÀÔ´Ï´Ù. ½ÇÁ¦¿¡¼­ ´ÙÀ½°ú °°ÀÌ ÇÒ °Ì´Ï´Ù.
Select Case cmdctlUser.Text
Case "xxxxx":
     ½ÇÇàÇÒ ÇÁ·Î½ÃÁ®
Case "xxxxx":
     ½ÇÇàÇÒ ÇÁ·Î½ÃÁ®
¡¦
End Select
¾ÆÁ÷ ÇÁ·Î½ÃÁ®¸¦ ¸¸µéÁö ¾ÊÀº °ü°è·Î ¿©±â¿¡¼­ ÀÌ°ÍÀ» ³ªÁßÀ¸·Î ¹Ì·ï µÓ½Ã´Ù.

End Sub

ÀÚ ÀÌÁ¦ ³¡³¯ ¶§°¡ µÈ °Í °°±º¿ä. ½ÇÁ¦ ¿©·¯ À¯ÇüÀÇ ¹öÆ°ÀÌ ÀÖÁö¸¸ ½ÇÁ¦ »ç¿ë¾ÈµÇ´Â °Íµµ ÀÖ¾î °¡´ÉÇÑ °Í¸¸ °ñ¶ó º¸¿©µå·È½À´Ï´Ù. °¡·É [¼­½Äµµ±¸¸ðÀ½]ÀÇ ±¥¼±¹öÆ°, ¹è°æ»ö»ó¹öÆ° °°Àº °ÍÀº Àúµµ ¾ÆÁ÷ ±¸ÇöÇÏÁö ¸øÇß½À´Ï´Ù. ¾ðÁ¨°¡ ¾Ë°Ô µÇ¸é ¾Ë·Áµå¸®ÁÒ. Ȥ½Ã Áö±Ý ¾Æ½Ã´Â ºÐ ÀÖÀ¸½Ã¸é Àú¿¡°Ôµµ ±Í¶äÀ» ÇØÁÖ½Ã±æ ¹Ù¶ø´Ï´Ù.
¡¡

¸ñÂ÷ | ÀÌÀü | ´ÙÀ½¡¡

¡¡

¿ÀÇǽºÆ©ÅÍ ±â¾÷ASP¼­ºñ½º 135-880 ¼­¿ï½Ã °­³²±¸ »ï¼ºµ¿ 157-3 ¿¤ÁöÆ®À©ÅÚ 2Â÷ 1603È£ ¢Ï070-7098-2554
Copyright ¨Ï 1999-2008 Officetutor.com All rights reserved
¡¡