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

½Ð±Ð,¦p¦ó¨ú³Ì·sªºÀɦW?

½Ð±Ð,¦p¦ó¨ú³Ì·sªºÀɦW?

¹ê¦b·Q¤£¥X¨Ó,,,³Â·Ð¥ý¶i«ü¾É¤F.

Workbooks.Open Filename:="C:\B\A123.xlsx"
  Windows("C:\B\A123.xlsx").Activate
  Range("A1:AG1000").Select
  Selection.Copy

¦]³o­ÓC:\B\  ¤º¤§ÀÉ®×,
a202007151019.xlsx  ­n§ï¦¨ A123.xlsx  
.
.
a202007161120.xlsx  ­n§ï¦¨ A123.xlsx  

¥Ñ¨t²Î¨ú¥X«á,a202007161120.xlsx  ¤§·s¸ê®Æ,,¨C¦¸³£»Ý§ó¦W A123.xlsx   ,¤~¥i°õ¦æ¥¨¶°.


¤£¬O¬O§_¥i¦³¾÷·|,ÀɦWÅܯB°Ê,¨Ì¸ê®Æ§¨¤º¤§³Ì·s§ó·sªºÀÉ®×a........xlsx ,¶}±Ò½Æ»s?



³Â·Ð.
.

·PÁÂ ikboy ¨ó§U
¤]ÁÂÁÂn7822123


·PÁ§A­Ì

TOP

¨ú c:\b\ ¤º¨ú·s¥H a ¶}ÀYªº xlsx ÀɮצW¡C
  1. Sub zz()
  2. Dim pfn$ 'Path & file name
  3.     pfn = "c:\b\a*.xlsx"
  4.     With CreateObject("Wscript.Shell")
  5.         pfn = Split(.exec("cmd /c dir /o-d /b " & pfn).StdOut.ReadAll, vbCrLf)(0)
  6.     End With
  7. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2020-7-16 12:17 ½s¿è

¦^´_ 1# tomking

³Ì·sªºÀɦW©w¸q¬O¤°»ò?

1.ÀɦW±Æ§Ç³Ì¾a«á
2.³Ì«á­×§ï®É¶¡ªºÀÉ®×
3.³Ì«á«Ø¥ßªºÀÉ®×

ÁÙ¬OÅý¨Ï¥ÎªÌ¥Î¤â°Ê¤è¦¡¿ï¾ÜÀɮקa~§ó¼u©Ê

·s¼W¤@­Ó°Æ¨ç¼Æ"GetFileFullName"§Y¥i°µ¨ì


Sub §Aªºµ{¦¡()
Workbooks.Open Filename:=GetFileFullName
Windows("C:\B\A123.xlsx").Activate
Range("A1:AG1000").Select
Selection.Copy
'...
'...
'...
End Sub

Function GetFileFullName()  As String
With Application.FileDialog(msoFileDialogFilePicker)
  .Filters.Clear                      '¥ý²M°£¥i¿ïÀɮײM³æ
  .Filters.Add "excelÀÉ®×", "*.xls;*.xlsx;*.xlsm"  '­­©w¿ï¨úÀɮתº²M³æ
  .InitialFileName = "C:\B"  '¿ï¨úµøµ¡³Ìªìªº¸ê®Æ§¨¦ì¸m
  .AllowMultiSelect = False  '¤£¥i¦h¿ï
  If .Show = 0 Then Exit Function '¨S¿ï¾Ü´NÂ÷¶}
  GetFileFullName = .SelectedItems(1)
End With
End Function
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

        ÀR«ä¦Û¦b : §ïÅܦۤv¬O¦Û±Ï¡A¼vÅT§O¤H¬O±Ï¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD