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

[µo°Ý] VBA«ö¶s±±¨îµ{¦¡½X¦r¦ê

[µo°Ý] VBA«ö¶s±±¨îµ{¦¡½X¦r¦ê

¦U¦ì«e½ú¦n¡A·Q½Ð±Ð¦U¦ì«e½ú
¤p§Ì²{¦b¦³²£«~OO¸ò²£«~XX
EXCEL¤º°O¿ýªº¸ê®Æ¤j¦P¤p²§
²{¦b­n§â¤º³¡¸ê®Æ¶×¥X

°ò¥»¥\¯à¤p§Ì¬O¼g¦n¤F¡A¤À§O¼g¤FOO¸òXX¦U¦Ûªºµ{¦¡½X
¦ý¬Oµo²{­×§ïªº®É­Ô¥i¯à¥u¦³§ï¨ì¬Y¤@­Ó
¦³ÂI¤Ó¯Ó®É¶¡

¦³¨â­Ó«ö¶s¤À§O¬°¡AOO¸òXX
¦]µ{¦¡½X¤ºªº¤lµ{¦¡¡A©R¦W¤j·§´N¹³OO-export¡BXX-export¡AOO-Import¡BXX-Import...
¤£ª¾¹D¬O§_¯à§ï¬°¤@­P TT-export¡BTT-Import
³z¹L¨Ï¥ÎªÌÂI¿ïOO¸òXXªº«ö¶s´N¥i¥H©I¥s¬Û¹ïÀ³ªº¥\¯à...

¥ú¬O¼g¥X°ò¥»¥\¯à´N¤w¸g¯Ó±¼±Nªñ¨â­Ó¤ë®É¶¡
§Æ±æ¦U¦ì«e½ú¯àÀ°¤p§Ì¸Ñ´b:Q

§Ú·Q±z¥i¯à¥i¥H¬d¬Ý¬Ý Application.Caller

TOP

¥»©«³Ì«á¥Ñ u800901 ©ó 2021-3-9 21:48 ½s¿è

¦^´_ 2# qekqo
ÁÂÁ¦^´_:'(

¤£¹L§Ú­è­è¤w¸g¬ã¨s¥X¨Ó¤F!!!
³o¼Ë¥u­n¥h­×§ïfunction¤ºªºµ{¦¡½X¡A¬Æ¦Üuserform¤ºªºÄÝ©Ê
²×©ó¤£¥Î¦A°µ¨â¹M¤u¤F...:'(

´ú¸Õµ{¦¡½X¦p¤U
  1. Option Explicit
  2. Public TT As String
  3. Dim TT_sh_Database, TT_sh_Export As Worksheet
  4. -------------------------------------------------------------------------------------------------
  5. Private Sub cmbOO_Click()

  6.     TT = test_func("OO")
  7.    
  8. End Sub
  9. -------------------------------------------------------------------------------------------------
  10. Private Sub cmbXX_Click()
  11.    
  12.     TT = test_func("XX")
  13.    
  14. End Sub
  15. -------------------------------------------------------------------------------------------------
  16. Function test_func(ByRef TT As String)
  17.    
  18.     Dim wb As Workbook
  19.     Dim sh As Worksheet
  20.    
  21.     Set wb = ThisWorkbook
  22.     Set TT_sh_Database = wb.Sheets(TT & "-Database")
  23.     Set TT_sh_Export = wb.Sheets(TT & "-Export")
  24.    
  25.     If TT = "OO" Then
  26.         TT_sh_Database.Select
  27.     Else
  28.         TT_sh_Export.Select
  29.     End If
  30.    
  31. Msgbox TT

  32. End Function
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤H¨ÆªºÁ}Ãø»PµZ¿i¡A´N¬O¤@ºØ¦ÒÅç¡C
ªð¦^¦Cªí ¤W¤@¥DÃD