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

[µo°Ý] ¥HA2Àx¦s®æ¬°ÀɦW,°µ¦¨¤p­p³øªí

¦^´_ 10# PJChen
  1. Sub Ex()
  2. Dim A As Range
  3. fs = ThisWorkbook.Sheets("VBA").[A2] 'A2¬°ÀɦW
  4. With Workbooks(fs)
  5. .Sheets("³øªí").UsedRange = .Sheets("³øªí").UsedRange.Value
  6. .Sheets("³øªí").Copy '§â³øªí½Æ»s¨ì·sÀÉ®×
  7. .Close 0 'Ãö³¬a.xlsx
  8. End With
  9. Application.DisplayAlerts = False 'Ãö³¬¹ï¸Ü¤è¶ô
  10. ActiveWorkbook.SaveAs "D:\©â¤ô¾÷¼Æ¾Ú¤ÀªR_­È.xlsx" '±N·sÀÉÀx¦s
  11. With Workbooks("©â¤ô¾÷¼Æ¾Ú¤ÀªR_­È.xlsx") '³øªí·sÀÉ®×
  12. With .Sheets("³øªí")
  13. .UsedRange = .UsedRange.Value '¥h°£¤½¦¡
  14. .Range("A1").CurrentRegion.Subtotal GroupBy:=4, Function:=xlSum, TotalList:=Array(10, 11), _
  15.         Replace:=True, PageBreaks:=False, SummaryBelowData:=True '¤w³sÄò¤é´Á¤À²Õ¤p­p
  16. .[A:D].Delete '§R°£A:DÄæ¦ì
  17. If .[B3] = "" Then .Rows(3).Delete
  18. With .Range("F:F").SpecialCells(xlCellTypeFormulas)
  19. .Offset(, -1) = "­p"
  20. For Each A In .Cells 'µe®Ø½u
  21. A = Round(A, 2) '¥|±Ë¤­¤J
  22. A.Offset(, 1) = Round(A.Offset(, 1), 2) '¥|±Ë¤­¤J
  23.    For i = 7 To 10
  24.        A.Offset(, -1).Resize(, 3).Borders(i).Weight = xlThick '®Ø½u¼e«×
  25.        A.Offset(, -1).Resize(, 3).Borders(i).ColorIndex = 3 '®Ø½uÃC¦â
  26.    Next
  27. Next
  28. End With
  29. End With
  30. .Save
  31. End With
  32. Application.DisplayAlerts = True
  33. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 11# Hsieh

¤j¤j,
§Ú´ú¸Õ«áµo²{ ¥|±Ë¤­¤J«á ¤p­p»PÁ`­p·|¦³¤p¼Æ®t,¤£ª¾­n¦p¦ó¸Ñ¨M?

TOP

¦^´_ 11# Hsieh

¤j¤j,
³Â·Ð±z«Ü¦h,¤£­n¦A§ï¤F.
§Ú·Q§ï¬°¥|±Ë¤­¤J¤p¼Æ²Ä¤T¦ì,³o¼Ë´N¤£·|¦³¤£²Åªº±¡§Î¤F.

TOP

¦^´_ 11# Hsieh

¤j¤j,
³Ò·Ð±zÀ°¦£§ï­Ó¤p¦a¤è,¦b³Ì«áÄæ¦ìªº¤p­p¤ÎÁ`­p·|¥X²{¶Â½u,¥i§_§ï¦¨¥H¤Uªº¼Ë¦¡? ÁÂÁÂ!!
³Ì«áªº¤p­p.jpg

TOP

¦^´_ 14# PJChen
µ{¦¡½X³£¦³µù¸Ñ¡A½Ð¤F¸Ñµ{¦¡½X´N¯à¦Û¦æ§ó§ï
  1. Sub Ex()
  2. Dim A As Range
  3. fs = ThisWorkbook.Sheets("VBA").[A2] 'A2¬°ÀɦW
  4. With Workbooks(fs)
  5. .Sheets("³øªí").UsedRange = .Sheets("³øªí").UsedRange.Value
  6. .Sheets("³øªí").Copy '§â³øªí½Æ»s¨ì·sÀÉ®×
  7. .Close 0 'Ãö³¬a.xlsx
  8. End With
  9. Application.DisplayAlerts = False 'Ãö³¬¹ï¸Ü¤è¶ô
  10. ActiveWorkbook.SaveAs "D:\©â¤ô¾÷¼Æ¾Ú¤ÀªR_­È.xlsx" '±N·sÀÉÀx¦s
  11. With Workbooks("©â¤ô¾÷¼Æ¾Ú¤ÀªR_­È.xlsx") '³øªí·sÀÉ®×
  12. With .Sheets("³øªí")
  13. .UsedRange = .UsedRange.Value '¥h°£¤½¦¡
  14. .Range("A1").CurrentRegion.Subtotal GroupBy:=4, Function:=xlSum, TotalList:=Array(10, 11), _
  15.         Replace:=True, PageBreaks:=False, SummaryBelowData:=True '¤w³sÄò¤é´Á¤À²Õ¤p­p
  16. .[A:D].Delete '§R°£A:DÄæ¦ì
  17. If .[B3] = "" Then .Rows(3).Delete
  18. With .Range("F:F").SpecialCells(xlCellTypeFormulas)
  19. .Offset(, -1) = "­p"
  20. For Each A In .Cells 'µe®Ø½u
  21. A = Round(A, 3) '¥|±Ë¤­¤J¤p¼ÆÂI3¦ì
  22. A.Offset(, 1) = Round(A.Offset(, 1), 3) '¥|±Ë¤­¤J¤p¼ÆÂI3¦ì
  23.    For i = 7 To 10
  24.        A.Offset(, -1).Resize(, 3).Borders(i).Weight = xlThick '®Ø½u¼e«×
  25.        A.Offset(, -1).Resize(, 3).Borders(i).ColorIndex = 3 '®Ø½uÃC¦â
  26.    Next
  27. Next
  28. End With
  29. For i = 1 To .Cells(.Rows.Count, "E").End(xlUp).CurrentRegion.Rows.Count 'Á`­pªí®æµe®Ø½u
  30.     For j = 7 To 10
  31.        With .Cells(.Rows.Count, "E").End(xlUp).CurrentRegion.Rows(i).Borders(j)
  32.           .Weight = xlThick
  33.           .ColorIndex = 3
  34.         End With
  35.     Next
  36. Next
  37. End With
  38. .Save
  39. End With
  40. Application.DisplayAlerts = True
  41. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 15# Hsieh

·PÁ¤j¤H,°õ¦æµL»~!!

TOP

        ÀR«ä¦Û¦b : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD