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

½Ð°Ývba¨Ï¥Î¨t²Î¤º«Ø¨Ó¸ÑÀ£ÁYzip??

½Ð°Ývba¨Ï¥Î¨t²Î¤º«Ø¨Ó¸ÑÀ£ÁYzip??

±z¦n!
½Ð±Ð¦U¦ì«e½ú
¥Ø«e¤p§Ì·Q¨Ï¥Î¥H¤U¨Ó¸ÑÀ£ÁY
Fname = Application.GetOpenFilename(filefilter:="Zip Files (*.zip), *.zip", MultiSelect:=False)
FileNameFolder = ThisWorkbook.Path & "\" & folder_name & "\"
Worksheets("¤u§@ªí1").Range("F2") = FileNameFolder
Set oApp = CreateObject("Shell.Application")
oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(Fname).items
¥Ø«e´ú¸Õ¦¨¥\¡A
¦ý¨Ï¥Î³o¤è¦¡¡AÁٻݿï¾Ü©Ò»Ý­n¸ÑÁYªºÀɮסA
½Ð°Ý¬O§_¥i¥H¤£»Ý¿ï¾Ü¦Ó¦Û¦æ¸ÑÀ£ÁY
ps.ÀɮצWºÙ»P¸ê®Æ§¨¦WºÙÂ^¨ú¦ÛWorksheets("¤u§@ªí1").Range("F2")

¸ü·Ð½Ð¦U¦ì«e½ú«ü¾É
ÁÂÁÂ

¦^´_ 1# lshsien

¸Õ¸Õ¬Ý¡A¬O¤£¬O³o¼Ë?
  1.     Sub ¸ÑÀ£ÁY¤å¥ó()
  2.         Dim Rarexe As String  'WINRAR°õ¦æ¤å¥óªº¦ì¸m
  3.         Dim FileString As String 'Shell«ü¥O¤¤ªº¦r²Å¦ê
  4.         Dim Result As Long
  5.         Rarexe = "C:\program files\winrar\winrar"  'WINRAR°õ¦æ¤å¥óªº¦ì¸m
  6.         '[B1]Äæ¦ì ¸ÑÀ£ÁY«eªº­ì©l¤å¥ó
  7.         '[B2]Äæ¦ì ¸ÑÀ£ÁY«áªº¥Ø¦a¤å¥ó
  8.         FileString = Rarexe & " x " & "-Y " & [B1] & " " & [B2]  '«ü©w-Y ¶}Ãö¡A¡§¬O¡¨¬°Àq»{­È¡A¨Ã¦Û°Ê¦^À³¥þ³¡ªº¸ß°Ý¡C
  9.         Result = Shell(FileString, vbHide)
  10.     End Sub
½Æ»s¥N½X
ÁÙ¦³¥t¤@­Ó§ó«K§Qªº¤èªk¡A¦ý§Ú¥\¤O¤£°÷²`«p¡A­n½Ð°ª¤â¨ÓÀ°¦£¤F¡ã
µ{¦¡½X¦p¤U¡A»Ý¥t¥~¶K¦b¤W­±µ{¦¡ªº³Ì¤W¤è
³o¤èªk¬Oª½±µÂIÄæ¦ì¡A´N·|¦Û°Ê±a¥X¸ô®|
  1. Option Explicit
  2. Private Sub Worksheet_SelectionChange(ByVal Target As Range)

  3.     Dim gb As FileDialog    '«Å§i¤@­ÓÀÉ®×¹ï¸Ü®Ø
  4.     'Dim fd As FileDialog    '«Å§i¤@­ÓÀÉ®×¹ï¸Ü®Ø

  5.     Set gb = Excel.Application.FileDialog(msoFileDialogFilePicker)  '³]©w¿ï¨úÀÉ®×¥\¯à
  6.     'Set fd = Application.FileDialog(msoFileDialogFolderPicker)  '³]©w¿ï¨ú¸ê®Æ§¨¥\¯à
  7.    
  8.     With Target(1)
  9.         If .Address = "$B$1" Then If gb.Show Then .Cells = gb.SelectedItems(1) 'ÂI¿ï­þ­ÓÄæ¦ìÀx¦s®æ,Àɮ׸ô®|¨q¦b¨º­ÓÄæ¦ì
  10.         'If .Address = "$B$2" Then If fd.Show Then .Cells = fd.SelectedItems(1) 'ÂI¿ï­þ­ÓÄæ¦ìÀx¦s®æ,Àɮ׸ô®|¨q¦b¨º­ÓÄæ¦ì
  11.     End With

  12. End Sub
½Æ»s¥N½X

¸ÑÀ£ÁY.rar (8.16 KB)

§Ú«Ü²Â,©Ò¥H§Ú«Ü¥Î¤ß
¡@§Ú¾ÇÃÀ¤£ºë,¦ý§Ú´÷¨Dª¾ÃÑ

TOP

¦^´_ 1# lshsien
§A¼g¤Ï¤F§a
Fname = Worksheets("¤u§@ªí1").Range("F2").value          '±qF2¨ú±ozipÀɸô®|
FileNameFolder = ThisWorkbook.Path & "\" & folder_name & "\"        '¸ÑÀ£ÁY¦ì¸m
Set oApp = CreateObject("Shell.Application")
oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(Fname).items

TOP

·PÁ»k¥ú°j¯T¤j¤j
¤w¸g¸ÕÅ禨¥\¤F

·PÁÂstillfish00§ó¥¿

TOP

¦^´_ 4# lshsien


§A¥Î¸Õ¦¨¥\ªº¤èªk¬O
¡@¥i§_¤À¨É¤@¤U¡A¤¬¬Û¾Ç²ß
§Ú«Ü²Â,©Ò¥H§Ú«Ü¥Î¤ß
¡@§Ú¾ÇÃÀ¤£ºë,¦ý§Ú´÷¨Dª¾ÃÑ

TOP

¦^´_ 3# stillfish00


stillfish00 ¤j¤j¡G

¡@½Ð°Ý¥H¤Uµ{¦¡­n«ç»ò§ï¡A¤~¯à¨â­Ó±ø¥ó³£¦¨¥ß¡A¨Ã¥¿±`°õ¦æµ{¦¡?
  1. Option Explicit
  2. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  3.     Dim gb As FileDialog    '«Å§i¤@­ÓÀÉ®×¹ï¸Ü®Ø
  4.     'Dim fd As FileDialog    '«Å§i¤@­ÓÀÉ®×¹ï¸Ü®Ø
  5.     Set gb = Excel.Application.FileDialog(msoFileDialogFilePicker)  '³]©w¿ï¨úÀÉ®×¥\¯à
  6.     'Set fd = Application.FileDialog(msoFileDialogFolderPicker)  '³]©w¿ï¨ú¸ê®Æ§¨¥\¯à
  7.     With Target(1)
  8.         If .Address = "$B$1" Then If gb.Show Then .Cells = gb.SelectedItems(1) 'ÂI¿ï­þ­ÓÄæ¦ìÀx¦s®æ,Àɮ׸ô®|¨q¦b¨º­ÓÄæ¦ì
  9.         'If .Address = "$B$2" Then If fd.Show Then .Cells = fd.SelectedItems(1) 'ÂI¿ï­þ­ÓÄæ¦ìÀx¦s®æ,Àɮ׸ô®|¨q¦b¨º­ÓÄæ¦ì
  10.     End With
  11. End Sub
½Æ»s¥N½X
§Ú«Ü²Â,©Ò¥H§Ú«Ü¥Î¤ß
¡@§Ú¾ÇÃÀ¤£ºë,¦ý§Ú´÷¨Dª¾ÃÑ

TOP

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2014-11-5 00:09 ½s¿è

¦^´_ 6# »k¥ú°j¯T
­Y¬O¤@­ÓÀɮפ@­Ó¸ê®Æ§¨:
  1. Option Explicit
  2. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  3.     Dim gb As FileDialog    '«Å§i¤@­ÓÀÉ®×¹ï¸Ü®Ø
  4.     Dim fd As FileDialog    '«Å§i¤@­ÓÀÉ®×¹ï¸Ü®Ø
  5.     With Target(1)
  6.         If .Address = "$B$1" Then
  7.             Set gb = Excel.Application.FileDialog(msoFileDialogFilePicker)  '³]©w¿ï¨úÀÉ®×¥\¯à
  8.             If gb.Show Then .Cells = gb.SelectedItems(1) 'ÂI¿ï­þ­ÓÄæ¦ìÀx¦s®æ,Àɮ׸ô®|¨q¦b¨º­ÓÄæ¦ì
  9.         ElseIf .Address = "$B$2" Then
  10.             Set fd = Application.FileDialog(msoFileDialogFolderPicker)  '³]©w¿ï¨ú¸ê®Æ§¨¥\¯à
  11.             If fd.Show Then .Cells = fd.SelectedItems(1) 'ÂI¿ï­þ­ÓÄæ¦ìÀx¦s®æ,Àɮ׸ô®|¨q¦b¨º­ÓÄæ¦ì
  12.         End If
  13.     End With
  14. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 7# stillfish00


    ÁÂÁ stillfish00 ¤j¤jªº¦^µª¡A¥i¥H¥¿±`°õ¦æ¤F¡A¸U¤À·PÁ¡ã
§Ú«Ü²Â,©Ò¥H§Ú«Ü¥Î¤ß
¡@§Ú¾ÇÃÀ¤£ºë,¦ý§Ú´÷¨Dª¾ÃÑ

TOP

³æ¤@Àɮ׳æ¤@¸ô®|¸ÑÀ£¦¨¥\¡A¯d¤U¬ö¿ý°Ñ¦Ò°Ñ¦Ò¡I
  1. Sub vba_unzip()
  2.     Dim oApplicationlication As Object
  3.     Dim fileName As Variant
  4.     Dim folderFileName As Variant
  5.     'fileName = Application.GetOpenFilename(filefilter:="Zip Files (*.zip), *.zip", MultiSelect:=False)
  6.     fileName = "E:\´Á¥æ©Ò\opdata\OptionsDaily_2018_02_21.zip"
  7.     folderFileName = "e:\test\"
  8.     'MkDir folderFileName
  9.     Set oApplication = CreateObject("Shell.Application")
  10.     oApplication.Namespace(folderFileName).CopyHere oApplication.Namespace(fileName).items
  11.     DoEvents

  12. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : °µ¸Ó°µªº¨Æ¬O´¼¼z¡A°µ¤£¸Ó°µªº¨Æ¬O·Mè¡C
ªð¦^¦Cªí ¤W¤@¥DÃD