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

[µo°Ý] ¨Ì·Ó³øªí§ë½u¶q»PUPH<¨C¤p®É²£¯à>­pºâ¶}¾÷¼Æ -- µo°Ý

¦^´_ 19# v03586
¸Õ¸Õ¬Ý¡G
  1. Sub ­pºâ·í¤é¶}¾÷¼Æ()
  2.     Dim RepSht As Worksheet, RepArr, xD1, xD2, R&, C&
  3.              .
  4.              .
  5.              .
  6.     '  ¦¹³B©I¥s
  7.     GetSubTot
  8.     Application.GoTo xSht.[A2]
  9. End Sub
½Æ»s¥N½X
¼W¥[³¡¤À¡G
  1. Sub GetSubTot()
  2.     Dim Btm As Long, rPos As Long
  3.    
  4.     With Sheets("¶}¾÷¼Æ")
  5.         Btm = .Range("A" & Rows.Count).End(xlUp).Row
  6.         rPos = Sheets("¶}¾÷¼Æ").UsedRange.End(xlToRight).Column
  7.         If (Cells(1, rPos) = "Total") Then rPos = rPos - 1
  8.         .Cells(1, rPos + 1) = "Total"
  9.         .Cells(2, rPos + 1).Resize(Btm - 1).Formula = "=SUM(F" & 2 & ":T" & 2 & ")"
  10.         .Cells(2, rPos + 1).Resize(Btm - 1) = .Cells(2, rPos + 1).Resize(Btm - 1).Value
  11.         .Cells(Btm + 1, "B") = "                        Total"
  12.         .Cells(Btm + 1, "F").Resize(, 16).Formula = "=SUM(F" & 2 & ":F" & Btm & ")"
  13.         .Cells(Btm + 1, "F").Resize(, 16) = .Cells(Btm + 1, "F").Resize(, 16).Value
  14.     End With
  15. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦h°µ¦h±o¡C¤Ö°µ¦h¥¢¡C
ªð¦^¦Cªí ¤W¤@¥DÃD