¬d¸ß¦hµ§ExcelÀɮ׫ü©w¬¡·~ï¸ê®Æ,¦hµ§¦C¥X
- ©«¤l
- 233
- ¥DÃD
- 53
- ºëµØ
- 0
- ¿n¤À
- 292
- ÂI¦W
- 0
- §@·~¨t²Î
- WinXp
- ³nÅ骩¥»
- 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-1-6
- ³Ì«áµn¿ý
- 2024-3-8
|
¬d¸ß¦hµ§ExcelÀɮ׫ü©w¬¡·~ï¸ê®Æ,¦hµ§¦C¥X
|
|
|
|
|
|
- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# jackson7015 - Option Explicit
- Dim Wb(1 To 2) As Workbook, xlText As String, S As Integer, AR()
- Const ¤u§@ï = "¬d¸ß¥Î"
- Sub ¬d¸ß_A() 'n¬d¸ß¸ê®Æªº¬¡¶Ã¯¤w¶}±Ò
- ¥D¬¡¶Ã¯
- For Each Wb(2) In Workbooks '©Ò¦³¶}±Òªº¬¡¶Ã¯
- If Wb(1).Name <> Wb(2).Name Then ¸ê®Æ¬d¸ß
- Next
- ¸m¤J¸ê®Æ
- End Sub
- Sub ¬d¸ß_B() 'n¬d¸ß¸ê®Æªº¬¡¶Ã¯¥¼¶}±Ò: ¥B»P¥D¬¡¶Ã¯¦b¦P¤@¸ê®Æ§¨ ¬d¸ß "*¤u§@¤é³øªí.xls" ¬¡¶Ã¯ªº¸ê®Æ
- Dim xlFile As String, xlPath As String
- ¥D¬¡¶Ã¯
- xlPath = Wb(1).Path & "\"
- xlFile = Dir(xlPath & "*¤u§@¤é³øªí.xls")
- Wb(1).Activate
- Application.ScreenUpdating = False
- Do While xlFile <> ""
- If Wb(1).Name <> xlFile Then
- Set Wb(2) = Workbooks.Open(xlPath & xlFile)
- ¸ê®Æ¬d¸ß
- Wb(2).Close False
- End If
- xlFile = Dir
- Loop
- ¸m¤J¸ê®Æ
- Application.ScreenUpdating = True
- End Sub
- Sub ¬d¸ß_C() 'n¬d¸ß¸ê®Æªº¬¡¶Ã¯¥¼¶}±Ò: ¥Îµøµ¡¨Ó¿ï°_¨ú(«ü©w)¸ê®Æ§¨ ¬d¸ß "*¤u§@¤é³øªí.xls" ¬¡¶Ã¯ªº¸ê®Æ
- Dim xlPath As String, xlFile As String
- ¥D¬¡¶Ã¯
- With Application.FileDialog(msoFileDialogFolderPicker)
- .InitialFileName = Wb(1).Path & "\"
- If .Show = True Then
- xlPath = .SelectedItems(1) & "\"
- Else
- MsgBox "¨S¦³«ü©w ¸ê®Æ§¨"
- Exit Sub
- End If
- End With
- xlFile = Dir(xlPath & "*¤u§@¤é³øªí.xls")
- Wb(1).Activate
- Application.ScreenUpdating = False
- Do While xlFile <> ""
- If Wb(1).Name <> xlFile Then
- Set Wb(2) = Workbooks.Open(xlPath & xlFile)
- ¸ê®Æ¬d¸ß
- Wb(2).Close False
- End If
- xlFile = Dir
- Loop
- ¸m¤J¸ê®Æ
- Application.ScreenUpdating = True
- End Sub
- Sub ²M°£¸ê®Æ()
- With Wb(1).Sheets(¤u§@ï) 'µ{¦¡½X©Ò¦bªº¬¡¶Ã¯
- .Range("B4").CurrentRegion.Offset(2).Clear '²M°£Â¦³¸ê®Æ
- End With
- End Sub
- Private Sub ¥D¬¡¶Ã¯()
- Set Wb(1) = ThisWorkbook 'µ{¦¡½X©Ò¦bªº¬¡¶Ã¯
- 'Set Wb(1 =Workbooks("¤u§@¤é³øªí.xls") '¦b«ü©wªº¬¡¶Ã¯
- xlText = Wb(1).Sheets("¬d¸ß¥Î").TextBox1 'n·j´Mªº¦r¦ê
- S = 0
- End Sub
- Private Sub ¸ê®Æ¬d¸ß()
- Dim E As Range, Ay(), xi As Integer
- For Each E In Wb(2).Sheets(1).UsedRange.Rows '¤w¨Ï¥Î½d³òªº¦C
- If (E.Cells(1, 4) <> "" And IsNumeric(E.Cells(1, 4))) And Mid(E.Cells(1, 4), 1, Len(xlText)) = xlText Then '¤ñ¹ïDÄ椤ªº¦r¦ê
- ReDim Preserve AR(S) '«·s°t¸m°ÊºA°}¦CÅܼƪºÀx¦sªÅ¶¡¡C
- 'Preserve:¿ï¾Ü©Ê¤Þ¼Æ¡C·í§ïÅÜ즳°}¦C³Ì«á¤@ºûªº¤j¤p®É¡A¤´µM«O¦³ì¨Óªº¸ê®ÆªºÃöÁä¦r¡C
- ReDim Ay(1 To E.Cells.Count)
- For xi = 1 To E.Cells.Count '±N¤ñ¹ï¨ìªº¦C±q²Ä1Äæ ¨Ì§Ç¸m¤J°}¦C
- Ay(xi) = E.Cells(1, xi).Text
- Next
- AR(S) = Ay
- S = S + 1 '¤U¤@Ó¤ñ¹ï¨ìªº¦C ¤§°}¦C ¤¸¯À¯Á¤ÞÈ
- End If
- Next
- End Sub
- Private Sub ¸m¤J¸ê®Æ()
- Dim xi As Integer
- With Wb(1).Sheets(¤u§@ï) 'µ{¦¡½X©Ò¦bªº¬¡¶Ã¯
- If S > 0 Then
- .Range("B4").CurrentRegion.Offset(2).Clear '²M°£Â¦³¸ê®Æ
- For xi = 0 To S - 1
- .Range("B5").Offset(xi).Resize(1, UBound(AR(xi))).Value = AR(xi) '¨Ì§Ç¸m¤J ¤ñ¹ï¨ìªº¦C
- 'UBound ¨ç¼Æ ¶Ç¦^ LongÈ¡Aªí¥Ü«ü©w°}¦C¬Yºû³Ì¤j¥i¨Ï¥Îªº°}¦C¯Á¤Þ¡C
- Next
- Else
- MsgBox "¬dµL ¸ê®Æ"
- End If
- End With
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 233
- ¥DÃD
- 53
- ºëµØ
- 0
- ¿n¤À
- 292
- ÂI¦W
- 0
- §@·~¨t²Î
- WinXp
- ³nÅ骩¥»
- 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-1-6
- ³Ì«áµn¿ý
- 2024-3-8
|
¦^´_ 2# GBKEE
¥ý·PÁÂGBKEEª©¥D¤j¤jªº¦^À³
¥¿¦bºCºC¬ã¨s¤º®e¤¤
·PÁªþ¤W¤¤¤å»¡©ú¡AÅý¤p§Ì¯à³v¦æÆ[¹î¾Ç²ß
¥ý¦æ´ú¸Õ©M¬ã¨sµ{¦¡½X¥h
ÁÂÁ«ü±Ð¡I |
|
|
|
|
|
|