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

[µo°Ý] «ç»ò¦bUSERFORM¤¤¥[¤J¥i¿z¿ï½Æ¿ï¤§¾ðª¬¹Ï

[µo°Ý] «ç»ò¦bUSERFORM¤¤¥[¤J¥i¿z¿ï½Æ¿ï¤§¾ðª¬¹Ï

¦U¦ì«e½ú¦n~
¤p§Ì·Q°Ý¤@¤UÃö©ó¾ðª¬¹Ïªº°ÝÃD
¦p¤U¹Ï(1)

³o¬O§Úªºªí³æ³B²z¤¶­±
§Ú·Q­n¦b¥k¤è¿z¿ï²î²íªº¦a¤è¥[¤J¾ðª¬¹Ï¡A¹ï§Ú¿é¯Ã¤ÀªR«áªº¼ÐÅÒ¦C°µVSLªº¿z¿ï¡A¨Ã¥B¥i¥H°µ½Æ¿ï°Ê§@
¦p¤U¹Ï(2) ¬°§Ú¿é¯Ã¹L«á¤§ÀɮסA§Ú·Q¦bUSERFORM¤º¥[¤J¿z¿ï¾ðª¬¹Ï¦p¹Ï(3)³Ì«áÅܦ¨¹Ï(4)ªº¼Ë¤l

¿z¿ï¾ðª¬¹Ï01.png


½Ð°Ý¦U¦ì«e½ú
§ÚÀ³¸Ó­n¦p¦ó°µ©O?
¥Ø«e¤½¥q¹q¸£µLªkÀ£ÁYÀÉ®× ¬GµLªk¤W¶ÇÀÉ®×´£¨Ñ¦U¦ì«e½ú´ú¸Õ µy«á¸É¤W:dizzy:

¦b UserForm ¤º«Å§i "¤½¥Î¦r¨å" ª«¥ó¼Ò¦¡¡G
ªí³æ³B²z¨t²Î3.2 Ex2.rar (25.09 KB)
²Ä¤G¤ä¬O luhpro ¤j¤j«ü¾Éªº®×¨Ò¡F
¦b Module1 «Å§i "¤½¥Î¦r¨å" ª«¥ó¼Ò¦¡¡G
ªí³æ³B²z¨t²Î3.2 luhpro.rar (188.77 KB)
´£¨Ñ¦P¥\¯à²§³B²zªº¨â­ÓExcelÀɮסA
¨Ñ§@¾Ç²ß°Ñ¦Ò¡C

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-4-29 17:21 ½s¿è

¦^´_ 58# chaoyiho
¤T¡B ­ì¥»¬O¦bµ²§ô«e³B¸Ì¡uÁ`ªí¡v¹ïÀ³ªí³æ³B²z¤¶­±.ListBox ªº¿ï¶µ²M³æ¡C
        ­×§ï¬°¼W¦C¤§ Sav¡BJ.C.W¡B»P ¡uÁ`ªí¡v ¦P¨B¹ïÀ³ VSL¡A¦p ( ¤G¡B»¡©ú)¡F
        ¬G¥H¤U§ó§ï¬° "³Æµù"¡C
  1.     '  2016/04/26  ¼W¥[»P "EXCELªí³æ³B²z¤¶­±.ListBox" ªº³sµ²¡C
  2.     '  ©Ò¦³¼W¦C¤§ Sav¡BJ.C.W¡BP.C.O¡BPmax¡BStuffing Box¡BF.O.¡B
  3.     '  Exh¡BExh ¤u§@ªí³æ VSL ¤£»Ý»P ¡uÁ`ªí¡v¹ïÀ³¤§ VSL ¦P¨B¡F
  4.     '  ¥ç§Y¶È¶È¡uÁ`ªí¡v¹ïÀ³ªí³æ³B²z¤¶­±.ListBox ªº¿ï¶µ²M³æ¡C
  5.     '  «h±N "¥H¤U With ~ End With" ·s¼Wªº¡uµ{¦¡½X¡v¤º®e²¾¦Ü¦¹³B¡C
  6.     '  Dim cts As Integer
  7.    
  8.     '  With ActiveSheet.PivotTables("¼Ï¯Ã¤ÀªRªí1").PivotFields(" VSL")
  9.     '      For cts = 0 To EXCELªí³æ³B²z¤¶­±.ListBox1.ListCount - 1
  10.             '  .PivotItems(EXCELªí³æ³B²z¤¶­±.ListBox1.List(cts)).Visible = IIf(EXCELªí³æ³B²z¤¶­±.ListBox1.Selected(cts), True, False)
  11.             '  §ó²¼ä¡B§ã­nªº Assignment ªºªí¥Ü¦¡¡C
  12.     '          .PivotItems(EXCELªí³æ³B²z¤¶­±.ListBox1.List(cts)).Visible = EXCELªí³æ³B²z¤¶­±.ListBox1.Selected(cts)
  13.     '      Next cts
  14.     '  End With
  15.     '  -------------------------------------------------------------------------
  16. End Sub
½Æ»s¥N½X
¬°¦Ò¼{¾\ÄýªÌªº¤F¸Ñ«e¦]«áªG¡A¥H©úÁA«e«á­×§ï­ì¦]¤Î¤º®e¡A¯S±N­×¥¿«e¨Æ¶µ¯S§O
¤©¥H³Æµù¤è¦¡«O¯d¡A¥H«K»P­×¥¿«á¤º®e§@¤ñ¹ï¡A´£¿ô¨Ã¼W¶i "­×·~¥\¤O"¡C

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-4-29 17:14 ½s¿è

¦^´_ 58# chaoyiho
°w¹ï #58
¤£ª¾¹D¦³¨S¦³¥i¥H­«½Æ°Ê§@ªº¤è¦¡©O?
¦]¬°³o¼Ë¤lªº¤è¦¡¦ü¥G¬O¤@¦¸©Êªº
¤ÀªR¹L«á´NµLªk¦A°µ¿z¿ï ¥²¶·­n­«·s¦A¤@¦¸¤~¦³¿ìªk³B²z¤F(?)
------------------------------------------------------------------------
¬°¸Ñ¨M¶È¯à°õ¦æ¤@¦¸ªº§xÂZ°ÝÃD¡A­×¥¿¦¨¯à°÷­«½Æ¡u¥i¦h¦¸°õ¦æ¡v¡A§Y
¡y°õ¦æ¤ÀªR¡z¤§¡u¼Ï¯Ã¤ÀªRªí¡v¡A­×§ï¤º®e¦p¤U (¶È¦C¥Ü¥X­×§ï³¡¤À)¡G
¤@¡B
  1. Private Sub CommandButton3_Click()
  2.     If TestBookOpen("FORM_REPORT.xlsx") = "" Then MsgBox "ÀÉ®×¥¼¶}±Ò": Exit Sub '¸õ¥Xµ{§Ç

  3.     §R°£¤ÀªRµ²ªGªí                '  ¼W¥[§R°£¤ÀªR¤u§@ªí³æ¡A¥H«K¦A¦¸¡y°õ¦æ¤ÀªR¡z

  4.     Range("A1:M50192").Select
  5.     Range("A2").Activate
  6.     Sheets.Add
  7.     '  ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
  8.         "FORM_REPORT!R2C1:R50192C13", Version:=xlPivotTableVersion14). _
  9.         CreatePivotTable TableDestination:="¤u§@ªí1!R3C1", TableName:="¼Ï¯Ã¤ÀªRªí1", _
  10.         DefaultVersion:=xlPivotTableVersion14
  11.     '  2016/04/29  ­×¥¿¶È¯à°õ¦æ¤@¦¸ªº§xÂZ°ÝÃD
  12.     '  ­ì¥»¡y°õ¦æ¤ÀªR¡z¤§¡u¼Ï¯Ã¤ÀªRªí¡v¶È¯à°õ¦æ¤@¦¸¡A¬°¸Ñ¨M¦¹¤@§xÂZ°ÝÃD¡A¬G±N TableDestination
  13.     '  ¶Ç¤J­È "¤u§@ªí1!R3C1" ¤©¥H­×¥¿¬° ActiveSheet.Name & "!R3C1"¡A¦p¦¹«K¥i¦h¦¸°õ¦æ¤F¡C
  14.     ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
  15.         "FORM_REPORT!R2C1:R50192C13", Version:=xlPivotTableVersion14). _
  16.         CreatePivotTable TableDestination:=ActiveSheet.Name & "!R3C1", TableName:="¼Ï¯Ã¤ÀªRªí1", _
  17.         DefaultVersion:=xlPivotTableVersion14
  18.     '  Sheets("¤u§@ªí1").Select          '  ­ì¬°¡u¤u§@ªí1¡v¡A¦ý°õ¦æ²Ä¤G¦¸®É¬°¡u¤u§@ªí10¡v, «h·|²£¥Í¿ù»~°T®§
  19.     Sheets(ActiveSheet.Name).Select      '  ¬°°t¦X¡u¥i¦h¦¸°õ¦æ¡v¡A±Nªí³æ¦WºÙ§ï¥H°ÊºAÀH¾÷³B²z (2016/04/29)
  20.     Cells(3, 1).Select
½Æ»s¥N½X
¤G¡B
  1.     '  2016/04/26  ¼W¥[»P "EXCELªí³æ³B²z¤¶­±.ListBox" ªº³sµ²¡C
  2.     '  ©Ò¦³¼W¦C¤§ Sav¡BJ.C.W¡BP.C.O¡BPmax¡BStuffing Box¡BF.O.¡B
  3.     '  Exh¡BExh ¤u§@ªí³æ VSL §¡»P ¡uÁ`ªí¡v¹ïÀ³¤§ VSL ¦P¨B¡F
  4.     '  «h±N "¥H¤U With ~ End With" ·s¼Wªº¡uµ{¦¡½X¡v¤º®e²¾¦Ü¦¹³B¡C
  5.     Dim cts As Integer
  6.    
  7.     With ActiveSheet.PivotTables("¼Ï¯Ã¤ÀªRªí1").PivotFields(" VSL")
  8.         For cts = 0 To EXCELªí³æ³B²z¤¶­±.ListBox1.ListCount - 1
  9.             '  .PivotItems(EXCELªí³æ³B²z¤¶­±.ListBox1.List(cts)).Visible = IIf(EXCELªí³æ³B²z¤¶­±.ListBox1.Selected(cts), True, False)
  10.             '  §ó²¼ä¡B§ã­nªº Assignment ªºªí¥Ü¦¡¡C
  11.             .PivotItems(EXCELªí³æ³B²z¤¶­±.ListBox1.List(cts)).Visible = EXCELªí³æ³B²z¤¶­±.ListBox1.Selected(cts)
  12.         Next cts
  13.     End With

  14.     '  ¬°°t¦X¡u¥i¦h¦¸°õ¦æ¡v¡A¤©¥H­×¥¿§ï¥H°ÊºA¹ïÀ³·s²£¥Íªí³æ¦WºÙ¡A¥H§K²£¥Í¿ù»~  (2016/04/29)
  15.     '  Sheets("¤u§@ªí1").Select
  16.     Sheets(ActiveSheet.Name).Select
  17.     '  Sheets("¤u§@ªí1").Name = "Liner"
  18.     Sheets(ActiveSheet.Name).Name = "Liner"
  19.     '  Sheets("¤u§@ªí1").Copy Before:=Sheets(1)
  20.     Sheets(ActiveSheet.Name).Copy Before:=Sheets(1)
  21.     '  Sheets("¤u§@ªí1 (2)").Select
  22.     Sheets(ActiveSheet.Name).Select
  23.     '  Sheets("¤u§@ªí1 (2)").Name = "Exh"
  24.     Sheets(ActiveSheet.Name).Name = "Exh"
  25.     '  Sheets("¤u§@ªí1 (2)").Copy Before:=Sheets(1)
  26.     Sheets(ActiveSheet.Name).Copy Before:=Sheets(1)
  27.     '  Sheets("¤u§@ªí1 (3)").Select
  28.     Sheets(ActiveSheet.Name).Select
  29.     '  Sheets("¤u§@ªí1 (3)").Name = "F.O Inlet"
  30.     Sheets(ActiveSheet.Name).Name = "F.O Inlet"
  31.     '  Sheets("¤u§@ªí1 (3)").Copy Before:=Sheets(1)
  32.     Sheets(ActiveSheet.Name).Copy Before:=Sheets(1)
  33.     '  Sheets("¤u§@ªí1 (4)").Select
  34.     Sheets(ActiveSheet.Name).Select
  35.     '  Sheets("¤u§@ªí1 (4)").Name = "Stuffing Box"
  36.     Sheets(ActiveSheet.Name).Name = "Stuffing Box"
  37.     '  Sheets("¤u§@ªí1 (4)").Copy Before:=Sheets(1)
  38.     Sheets(ActiveSheet.Name).Copy Before:=Sheets(1)
  39.     '  Sheets("¤u§@ªí1 (5)").Select
  40.     Sheets(ActiveSheet.Name).Select
  41.     '  Sheets("¤u§@ªí1 (5)").Name = "Pmax"
  42.     Sheets(ActiveSheet.Name).Name = "Pmax"
½Æ»s¥N½X

TOP

¦^´_  c_c_lai

«e½ú±zªºÀɮקڤw¸g´ú¸Õ¹L¤F ªº½T¥i¥H¥Î!
¸g¹L§Ú¤@¦æ¤@¦æªº¤ñ¹ï»yªk«á
§Úµo²{§Úªº¿ù¦r ...
chaoyiho µoªí©ó 2016-4-28 11:19

¨ä¹ê³o«D§A¤§°ÝÃD¡AActiveWorkbook.PivotCaches ¦b°µ¹L¤@¦¸¤§«á¡A
¦ü¥GµLªk¦A¦¸³B²z¡A´Nºâ¬O§â©Ò¦³¤u§@ªí³æ§R°£¥u³Ñ¤U "FORM_REPORT"
¤@¼Ë·|¥X²{

°õ¦æ¶¥¬q¿ù»~ '5'
µ{§Ç©I¥s©Î¤Þ¼Æ¤£¥¿½T

»¡¯u®æªº¡A§Ú¨Ã¤£±E±x Excel ªº PivotTable ³B­ù¡A§A¥i¯à­n½Ð±Ð
ª©¤Wªº¦U¦ì¤j¤j¤F¡C

TOP

¦^´_ 55# c_c_lai

«e½ú±zªºÀɮקڤw¸g´ú¸Õ¹L¤F ªº½T¥i¥H¥Î!
¸g¹L§Ú¤@¦æ¤@¦æªº¤ñ¹ï»yªk«á
§Úµo²{§Úªº¿ù¦rº|¦rÁÙ¯uªº«Ü¦h...

«e½úªº³B²z¤è¦¡¬O³o­ÓÅÞ¿è
1.¶}±ÒÂÂÀÉ
2.¿z¿ï²î²í
3.«ö¤U¤ÀªR
4.µ²ªG

¦ý¬OÃö©ó2.»P3.
¤£ª¾¹D¦³¨S¦³¥i¥H­«½Æ°Ê§@ªº¤è¦¡©O?
¦]¬°³o¼Ë¤lªº¤è¦¡¦ü¥G¬O¤@¦¸©Êªº
¤ÀªR¹L«á´NµLªk¦A°µ¿z¿ï ¥²¶·­n­«·s¦A¤@¦¸¤~¦³¿ìªk³B²z¤F(?)
©Î¬O§Ú¤S°µ¿ù¤F©O?
½Ð«e½ú½ç±Ð!

TOP

¦^´_ 54# jackyq

§Úµo²{§Ú±`±`·|³o¼Ë
½Ð°Ý«e½ú Ãö©ó³o¼Ëªº°ÝÃD ¦³¤°»ò²ßºD©Î°Ê§@¥i¥H¹w¨¾©Î¾i¦¨¶Ü?

¦Ó¥B±z·|µo²{
§Úªºµ{¦¡½X¤º®e³£¶ë¦bUSERFORM¤¤
«Ü¦h­«½ÆªºÂØ¥y>>¦ü¥G¦³¤è¦¡¥i¥H¦X¨Ö¦¨¤@­Ó¤@°_«Å§i(Public?)

½Ð±Ð³o¸Ó«ç»ò³B²z©O?

TOP

¦^´_ 52# chaoyiho
ªí³æ³B²z¨t²Î3.2µ¥«Ý­×§ï.rar (633.3 KB)
³o°¦¬O§AÀ³¥Î luhpro ¤j¤jªº³B²z¼Ò¦¡¡G
ÀÉ®×.rar (305.26 KB)

TOP

¦^´_ 52# chaoyiho
³o¬O§A¨ÃµL¥ô¦ó¿ï¶µ¡A±µµÛª½±µÂI¿ï "°õ¦æ¤ÀªR" ©Ò²£¥Íªº¡A
¬O»ò¡H
§Ú¤w E-Mail ¶Ç ªí³æ³B²z¨t²Î3.2µ¥«Ý­×§ï.xlsm¡A ¥H¤Î­ì¥ýªº
ÀÉ®×.rar ¤F¡A§A°õ¦æ¬Ý¬Ý¡C

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-4-28 10:26 ½s¿è

¦^´_ 52# chaoyiho


#51 ¼Ó §Ú¬Ý¿ù¤F  ( While  ¬Ý¦¨ With )
§ó¥¿¤@¤U
¤j¤j¯uªº¬O¨Ó¦Ò¤j®a²´¤Oªº ( §ä¤£¦Pªº¹CÀ¸ ?? )

Private Sub CommandButton1_Click()
    If Application.FindFile = False Then
        MsgBox "±z¨S¦³¶}±Ò¥ÀÀÉ"
    End If
Dim lrow&   ' c_c_lai ¤j¤j§ä¥X
    lrow = 3
vD.RemoveAll
While Cells(lrow, 5) <> ""
      If Not vD.Exists(CStr(Cells(lrow, 5))) Then
        EXCELªí³æ³B²z¤¶­±.ListBox1.AddItem CStr(Cells(lrow, 5))
        vD(CStr(Cells(lrow, 5))) = lrow
      End If
      lrow = lrow + 1
Wend
End Sub

TOP

        ÀR«ä¦Û¦b : ½_ÁJµ²±o¶V¹¡º¡¡A¶V·|©¹¤U««¡A¤@­Ó¤H¶V¦³¦¨´N¡A´N­n¶V¦³Á¾¨Rªº¯ÝÃÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD