1. ¸Þ´º ¸¸µé±â-¥°
ÀÚ·á´Ù¿î·Îµå : ¿ÀÆ©°ø±¸ÇÔ001.xls
¾È³çÇϼ¼¿ä. ¿ÀÆ©°¡Á· ¿©·¯ºÐ.
Áö³ ¹ø¿¡ ¸»¾¸µå¸°´ë·Î ¿À´ÃºÎÅÍ´Â ±¸Ã¼ÀûÀÎ ÄÚµù°ú ÀÌ¿¡ ´ëÇÑ °¢ ¼³¸íÀ» µå¸®°íÀÚ ÇÕ´Ï´Ù. À̹ø ½Ã°£¿¡´Â ¿¢¼¿ÀÇ ¸Þ´º¿¡ »ç¿ëÀÚÁ¤ÀÇ
¸Þ´º¸¦ Ãß°¡ÇÏ´Â °ÍÀÔ´Ï´Ù.
¸ðµç À©µµ¿ìÇÁ·Î±×·¡¹Ö¿¡ ÀÖ¾î °¡Àå ¸ÕÀú ÇÒ ÀÏÀº ¾î¶² °³Ã¼°¡ ÇÊ¿äÇÑÁö ÆľÇÇÏ°í ±× °³Ã¼ÀÇ ÇÁ·ÎÆÛƼ(¼Ó¼º), ¸Þ¼Òµå(¹æ¹ý) ±×¸®°í
À̺¥Æ®(»ç°Ç)Áß ÇÊ¿äÇÑ °ÍÀ» ÆľÇÇصδ °ÍÀÔ´Ï´Ù.
ÀÚ~¾Æ ¿¢¼¿ÀÇ ¸Þ´º¸¦ ´Ù·ç±â À§Çؼ °¡Àå ¸ÕÀú ÇÊ¿äÇÑ °³Ã¼´Â CommandBarsÄ÷º¼ÇÀÔ´Ï´Ù. ¿ø·¡ 95¹öÀü±îÁö´Â MenuBars¶ó´Â
°³Ã¼¸¦ ÀÌ¿ëÇß½À´Ï´Ù. ±×·¯³ª ¿ÀÇǽºÀÇ Å¸¾ÖÇø®ÄÉÀ̼ǰú °ø¿ëÀ¸·Î »ç¿ëÇϱ⠹ٲî¾ú½À´Ï´Ù. ±×·¯¹Ç·Î ¿©±â¿¡¼ ¸»¾¸µå¸®´Â ÄÚµù°ú ¼³¸íÀº
¿ÀÇǽº97¹öÀüÀÌ»óÀ̾î¾ß ÇÕ´Ï´Ù.
ÀÌÁ¦ ÇÊ¿äÇÑ °³Ã¼°¡ CommandBarsÄ÷º¼Ç°³Ã¼¶ó´Â °ÍÀ» ¾Ë¾Ò½À´Ï´Ù. ±×·¯¸é CommandBarsÄ÷º¼Ç°³Ã¼¿¡ ¿ì¸®°¡ ¸¸µç °³Ã¼¸¦
Ãß°¡ÇØÁÖ´Â °ÍÀÌ ¸Þ´º±¸¼ºÀÇ ÀüºÎÀÔ´Ï´Ù. ¹°·Ð ¸»Àº °£´ÜÇÏÁö¸¸.
±×·¯¸é °³Ã¼¸¦ Ãß°¡ÇÏ·Á¸é µ¥ÀÌŸ°¡ ÇÊ¿äÇÕ´Ï´Ù. ´Ü¼øÈ÷ µ¥ÀÌŸµµ ¾ø´Â °³Ã¼¸¸ »ý¼ºÇÏ´Â °ÍÀº ¹«ÀǹÌÇÏ°ÚÁÒ. µÎ¹ø° ÇÒ ÀÏÀº µ¥ÀÌŸ¸¦
Á¤ÀÇÇÏ°í ¾î¶»°Ô °³Ã¼¿¡ µ¥ÀÌŸ¸¦ ÀÔÈú °ÍÀΰ¡¸¦ »ý°¢ÇغÁ¾ß ÇÕ´Ï´Ù.
Àú´Â ´ÙÀ½°ú °°ÀÌ ¸Þ´º¸¦ À§ÇÑ µ¥ÀÌŸ¸¦ Á¤ÀÇÇصξú½À´Ï´Ù.
¡¡
µ¥ÀÌÅÍ |
¼³¸í |
mnuLvl |
ÃÖ»ó´Ü /Áß°£ /ÇÏÀ§¸Þ´º¸¦ ±¸ºÐÇϱâ À§ÇÑ º¯¼ö |
mnuCaption |
¸Þ´ºÀÇ À̸§ |
mnuMacro |
¸Þ´º¸¦ Ŭ¸¯ÇÏ¸é ½ÇÇàÇÒ ÇÁ·Î±×·¥¸í |
mnuDivider |
¸Þ´º¿Í ¸Þ´º»çÀÌÀÇ ±¸ºÐ¼±Ç¥½Ã À¯¹« |
mnuFaceID |
¸Þ´º¿ÞÆíÀÇ ±×¸² |
mnuState |
Åä±Û¸Þ´º¸¦ Ç¥½ÃÇϱâ À§ÇÑ º¯¼ö |
mnuNextLvl |
ÇÏÀ§¸Þ´º°¡ Àִ°¡¸¦ ÆľÇÇϱâ À§ÇÑ º¯¼ö |
ÀÌ´Â ¸Þ´ºÀÇ ±¸¼ºÀ» »ìÆ캸¸é ¾Ë ¼ö Àִµ¥ ´ÙÀ½ ±×¸²À» ÂüÁ¶Çϼ¼¿ä
±×¸®°í ¸Þ´ºÀÇ Å×ÀÌŸ´Â ¿öÅ©½ÃÆ® Sheet1¿¡ µÎ¾ú½À´Ï´Ù. ´ÙÀ½ ±×¸²À» º¸½Ã¸é ¾Æ½Ç °Ì´Ï´Ù. ¹°·Ð ¿ÀÆ©°ø±¸ÇÔÀÇ ½ÃÀÛ´Ü°è¶ó ¾ÆÁ÷
Macro, FaceIDµî ºñ¾î ÀÖ´Â Çʵ尡 ¸¹½À´Ï´Ù.
¹°·Ð ¸Þ´ºÀÇ °üÇÑ Á¤º¸¸¦ ÀúÀåÇÏ¿© ºÒ·¯¿À´Âµ¥ ¿©·¯ ¹æ¹ýÀÌ ÀÖ½À´Ï´Ù. ¿©±âó·³ ¿öÅ©½ÃÆ®¿¡ ÀúÀåÇÏ´Â ¹æ¹ýµµ ÀÖ°í MDBÆÄÀÏ·Î ÀúÀåÇÏ´Â
ADO ³ª DAO°³Ã¼¸¦ ÀÌ¿ëÇÏ¿© Äõ¸®ÇÏ´Â ¹æ¹ýµµ ÀÖÁÒ. °¡Àå °£´ÜÇÑ ¹æ¹ýÀº ¾Æ¸¶ ÄÚµù¿¡ ¾Æ¿¹ »ðÀÔÇÏ´Â °ÍÀÏ °Ì´Ï´Ù. ¶Ç ¹Ì¸®
µµ±¸»óÀÚÀÇ ¹öÆ°À̶ó¸é ¼öÀÛ¾÷À¸·Î ¸¸µé¾î ³õ°í .xlb·Î ÀúÀåÇÏ´Â ¹æ¹ýµµ ÀÖÁÒ.
Option Explicit
Const USER_TAG As String = "UserMenu"
»ç¿ëÀÚÁ¤ÀÇ »ó¼ö¸¦ ¼±¾ðÇÏ¿´½À´Ï´Ù. À̸¦ ¼±¾ðÇÑ ÀÌÀ¯´Â »ç¿ëÀÚÁ¤ÀÇ ¸Þ´º»èÁ¦½Ã ¿¢¼¿ÀÇ ¸Þ´º¿Í »ç¿ëÀÚÁ¤ÀǸ޴º¸¦ ±¸ºÐÇϱâ À§ÇÑ °ÍÀÔ´Ï´Ù.
µÞºÎºÐÀÇ Sub DeleteUserMenu( )¿¡¼ ³ª¿ÀÁö¸¸ ¹Ì¸® ¸»¾¸µå¸®¸é ¸ðµç ¸Þ´º°³Ã¼¸¦ For Each~Next¸¦ ÀÌ¿ëÇÏ¿©
Ž»öÇÏ¸é¼ ÀÌ ²¿¸®Ç¥°¡ ÀÖÀ¸¸é ³»°¡ ¸¸µç °ÍÀ̹ǷΠ¾È½ÉÇÏ°í »èÁ¦ÇÏ·Á´Â °ÍÀÔ´Ï´Ù.
»ó¼ö¿¡´Â ¼¼ °¡Áö À¯ÇüÀÌ ÀÖ½À´Ï´Ù.
¡Ü ½Ã½ºÅÛ»ó¼ö(°íÀ¯»ó¼ö)
½Ã½ºÅÛ»ó¼ö¶õ ÀÀ¿ëÇÁ·Î±×·¥ÀÚü¿¡¼ Á¦°øÇÏ´Â °ÍÀ¸·Î °³Ã¼,¸Þ¼µå, ¼Ó¼ºÀ» »ç¿ëÇÒ ¶§ ÀÌ¿ëÇÒ ¼ö ÀÖ´Â »ó¼öÀÔ´Ï´Ù. VBE¿¡¼ F2¸¦ ´·¯
°³Ã¼Ã£¾Æº¸±â¸¦ ÇϽøé vb~ ³ª xl~ ·Î ½ÃÀÛÇÏ´Â ¸¹Àº »ó¼öµéÀ» º¸½Ç ¼ö ÀÖ½À´Ï´Ù.
¡Ü »ç¿ëÀÚÁ¤ÀÇ»ó¼ö
»ç¿ëÀÚÁ¤ÀÇ»ó¼ö´Â Const ¹®À» »ç¿ëÇÏ¿© ¼±¾ðÇÏ¸ç ¸» ±×´ë·Î »ç¿ëÀÚ Áï ÇÁ·Î±×·¡¸Ó°¡ ÇÊ¿äÇؼ µû·Î Á¤ÀÇÇÕ´Ï´Ù.
¡Ü Á¶°ÇºÎÄÄÆÄÀÏ»ó¼ö
#Const ¹®À» »ç¿ëÇÏ¿© ¼±¾ðÇÕ´Ï´Ù.
Const MENU_LEVEL0 As Byte = 1
Const MENU_LEVEL1 As Byte = 2
Const MENU_LEVEL2 As Byte = 3
¸Þ´ºÀÇ °èÃþÀûÀÎ ±¸Á¶¸¦ Ç¥ÇöÇÏ°í È®ÀÎÇϱâ À§ÇÑ »ó¼öÀÔ´Ï´Ù. »©¸ÔÀº °ÍÀÌ ÀÖ±º¿ä. º¸ÅëÀº »ó¼öÀÇ µ¥ÀÌÅÍÇüÀ» ÁöÁ¤ÇÏÁö ¾Ê°í »ç¿ëÇÕ´Ï´Ù.
°¡·É À§ÀÇ »ó¼ö¸¦ Const MENU_LEVEL0 = 1 À¸·Î Ç¥½ÃÇϱ⵵ ÇÕ´Ï´Ù. ±×·¯³ª Á¤È®ÇÑ µ¥ÀÌÅÍÇüÀ» ÁÖ´Â °ÍÀÌ ¾Æ¹«·¡µµ ³ªÀ»
°Í °°¾Æ Àú´Â »ó¼ö¿¡µµ µ¥ÀÌÅÍÇüÀ» Ç¥½ÃÇÕ´Ï´Ù.
Type mnuType
mnuLvl As Byte
mnuCaption As String
mnuMacro As String
mnuDivider As Boolean
mnuFaceID As Integer
mnuState As String
mnuNextLvl As Byte
End Type
À§¿¡¼ ¸»¾¸µå¸° ¸Þ´º°³Ã¼¿¡ ÀÔÈú µ¥ÀÌÅ͸¦ ´ãÀ» ±¸Á¶Ã¼¸¦ ¼±¾÷ÇÏ¿´½À´Ï´Ù. ¹°·Ð °³°³ÀÇ º¯¼ö¸¦ ±»ÀÌ Type¹®À» ½á°¡¸ç »ç¿ëÇÏÁö ¾Ê¾Æµµ
µË´Ï´Ù. ±×·¯³ª °°Àº ºÎ·ùÀÇ ÀÏÀ» ÇÏ´Â º¯¼ö¸¦ Çϳª·Î ÅëÀÏÇÏ´Â °ÍÀÌ ÄÚµù¿¡¼µµ º¸±âÁÁ°í ½ÇÁ¦ »ç¿ë¿¡¼µµ Æí¸®ÇÕ´Ï´Ù.
°¡·É Á÷¿øµéÀÇ µ¥ÀÌÅͺ£À̽ºÇÁ·Î±×·¥À» ÀÛ¼ºÇÑ´Ù¸é ´ÙÀ½°ú °°Àº ±¸Á¶Ã¼¸¦ Á¤ÀÇÇÕ´Ï´Ù.
Type EmployeeRecord
ID As Integer '»ç¿ø °íÀ¯Å° ȤÀº »ç¿ø¹øÈ£
Name As String * 20 'À̸§
Address As String * 30 'ÁýÁÖ¼Ò
Phone As Long 'ÀüȹøÈ£
HireDate As Date 'ÀÔ»çÀÏÀÚ
End Type
±×¸®°í ´ÙÀ½°ú °°ÀÌ »ç¿ëÇÕ´Ï´Ù.
Sub CreateRecord()
Dim Dept_Acctg(10) As EmployeeRecord 'ȸ°èºÎ¼ÀÇ µ¥ÀÌÅͺ£À̽º
Dim Dept_Mktg(10) As EmployeeRecord '¸¶ÄÉÆúμÀÇ µ¥ÀÌÅͺ£À̽º
Dim Dept_Sales(10) EmployeeRecord 'ÆǸ޺μÀÇ µ¥ÀÌÅͺ£À̽º
'ȸ°èºÎ¼ ù¹ø° Á÷¿ø ÀÚ·á
Dept_Acctg(0).ID=¡¦.
Dept_Acctg(0).Name=¡¦.
¡¦
Dept_Acctg(1).ID=¡¦.
Dept_Acctg(1).Name=¡¦.
'¸¶ÄÉÆúμ ù¹ø° Á÷¿ø ÀÚ·á
Dept_Mktg(0).ID=¡¦.
Dept_Mktg(0).Name=¡¦.
¡¦
Dept_Mktg(1).ID=¡¦.
Dept_Mktg(1).Name=¡¦.
¡¦
End Sub
ÀÌÁ¦ ¸Þ´º±¸¼ºÀ» À§ÇÑ »ó¼ö¿Í ±¸Á¶Ã¼º¯¼ö¼±¾ðÀÌ ³¡³µ½À´Ï´Ù.
ÀÌÁ¦ ¸Þ´º±¸¼ºÀ» À§ÇÑ SubÇÁ·Î½ÃÀú¸¦ »ìÆ캸ÁÒ.
Sub CreateUserMenu()
Dim cmdbarPopup As CommandBarPopup
< ¿öÅ©½ÃÆ®¸Þ´º¹Ù>
MENU_LEVEL0ÀÇ ¸Þ´º(¿ÀÆ©°ø±¸ÇÔ)¸¦ ¸¸µé±â À§Çؼ´Â ¿¢¼¿ÀÇ ¿öÅ©½ÃÆ®¸Þ´º¹Ù °³Ã¼¸¦ ÂüÁ¶ÇØ¾ß ÇÕ´Ï´Ù. À̸¦ ÂüÁ¶Çϱâ À§ÇÑ º¯¼ö
cmdbarPopup À» ¼±¾ðÇß½À´Ï´Ù. ±×¸®°í cmdbarPopup º¯¼öÀÇ µ¥ÀÌÅÍÇüÀº CommandBarPopupÀÔ´Ï´Ù. ÀÌ´Ü°è¿¡¼´Â
½ÇÁ¦ ¿öÅ©½ÃÆ®¸Þ´º¹Ù °³Ã¼¸¦ cmdbarPopup º¯¼ö¿¡ ÇÒ´çÇÑ °ÍÀº ¾Æ´Õ´Ï´Ù. ´Ù¸¸ ¼±¾ð¸¸ ÇصР°ÍÀÌÁÒ.
Dim cmdbarPup As CommandBarPopup
< MENU_LEVEL1 Æ˾÷¸Þ´º¹Ù>
cmdbarPupÀº CommandBarPopupº¯¼ö·Î¼ À§ÀÇ ±×¸²°ú °°Àº Æ˾÷¸Þ´º¸¦ ÀúÀåÇÒ °³Ã¼ÀÔ´Ï´Ù.
Dim cmdbarBtn As CommandBarButton
< MENU_LEVEL2 ¹öÆ°¸Þ´º¹Ù>
cmdbarBtn Àº CommandBarButtonº¯¼öÀ̸ç ÃÖÇÏÀ§°èÃþÀÇ ¸Þ´º¸¦ ´ã´Â º¯¼öÀÔ´Ï´Ù.
Dim bytBefore As Byte
Dim bytRow As Byte
bytBefore´Â ¿ÀÆ©°ø±¸ÇÔ¸Þ´º¸¦ ¿öÅ©½ÃÆ®¸Þ´º¹Ù³»ÀÇ À§Ä¡¸¦ ÀúÀåÇÕ´Ï´Ù.
bytRow´Â ¸Þ´ºÀÇ µ¥ÀÌÅ͸¦ ¿öÅ©½ÃÆ®·Î Àоî¿À±â À§ÇØ ÇàÀÇ ¹øÈ£¸¦ ÀúÀåÇÕ´Ï´Ù.
Dim usrMnu As mnuType
¾Õ¼ ¼±¾ðÇÑ ±¸Á¶Ã¼¸¦ µ¥ÀÌÅÍÇüÀ¸·Î ÇÏ´Â º¯¼ö¸¦ ¼±¾ðÇÕ´Ï´Ù. ÀÌÁ¦ º¯¼ö¸¦ »ç¿ëÇÏ·Á¸é usrMnu.mnuLvl ,
usrMnu.mnuCaptionµîµîÀ¸·Î »ç¿ëÇÕ´Ï´Ù.
DeleteUserMenu
ÇÁ·Î±×·¥¼Ò½º ÇÏ´Ü¿¡ ÀÖ´Â Sub DeleteUserMenu( )¸¦ ½ÇÇàÇÕ´Ï´Ù.
ÇÁ·Î½ÃÁ® À̸§À» º¸½Ã¸é ¾Ë°ÚÁö¸¸ »ç¿ëÀÚÁ¤ÀǸ޴º¸¦
»èÁ¦ÇÏ´Â ¿ªÇÒÀ» ÇÕ´Ï´Ù. ¾Æ´Ï ¸¸µé±âµµ Àü¿¡ ¹«½¼ »èÁ¦¸¦
¸ÕÀú ÇÏ´À³Ä°í ±Ã±ÝÇϽÇÅÙµ¥, ÀÌ´Â Sub CreateUserMenu( )¸¦ 2ȸÀÌ»ó
½ÇÇàÇÏ¿© ¿ÀÆ©°ø±¸ÇÔ¸Þ´º°¡ 2°³ÀÌ»ó »ý±â´Â ÀÏÀ» ¹æÁöÇϱâ
À§ÇÑ °ÍÀÌ Ã¹¹ø° ÀÌÀ¯ÀÔ´Ï´Ù. ±×¸®°í ÇÁ·Î±×·¥ÀÇ
°³¹ß´Ü°è¿¡¼´Â ÀÚÁÖ Sub CreateUserMenu( )¸¦ µ¹·Áº¼ÅÙµ¥ À̸¦
ÀÏÀÏÀÌ »èÁ¦ÇÏ·Á´Â ¼ö°í¸¦ ´ú±â À§ÇÑ °ÍÀÌ µÎ¹ø°
ÀÌÀ¯ÀÔ´Ï´Ù.
|