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

[µo°Ý] sumif¤½¦¡¦bVBA¤¤µLªk°õ¦æ

[µo°Ý] sumif¤½¦¡¦bVBA¤¤µLªk°õ¦æ

½Ð±Ð¦U¦ì°ª¤â
¦]¬°¸ê®Æ¶q¤£©T©w¡A·Q¥ÎÅܼƥN¤Jsumif¤½¦¡
¦b¨Ï¥Îsumif¤½¦¡®É¦p¥X²{"°õ¦æ¶¥¬q¿ù»~13"®É­n¦p¦ó°£¿ù?
ªì¾ÇVBA¡A½Ð¦U¦ì°ª¤â¤£§[½ç±Ð¡AÁÂÁ¡I

sumif.rar (6.86 KB)

¦^´_ 1# voyageellen
  1. Sub Mysumif()
  2. Dim abc1 As String, abc2 As String
  3.   Cells.Find(What:="¥N¸¹").Offset(1, 0).Activate
  4.     a = ActiveCell.Row
  5.   
  6.   ActiveCell.End(xlDown).Select
  7.     c = ActiveCell.Row
  8.   
  9.   Cells.Find(What:="¥N¸¹").Offset(1, 0).Activate
  10.     p = ActiveCell.Cells.Column
  11.   
  12.    abc1 = Range(Cells(a, p), Cells(c, p)).Address
  13.   
  14.    abc2 = Range(Cells(a, p + 1), Cells(c, p + 1)).Address
  15.   
  16.   Range("D1").Formula = "=sumif(" & abc1 & ",""BI""," & abc2 & ")"
  17. End Su
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ oobird ©ó 2013-5-23 09:00 ½s¿è

¥Îvba¼g¤J¤½¦¡­n³o¼Ë¡G
Sub sumif()
    Dim abc1$, abc2$
    abc1 = Cells.Find("¥N¸¹").Offset(1, 0).Address & ":" & Cells.Find("¥N¸¹").Offset(1, 0).End(xlDown).Address
    abc2 = Cells.Find("­È").Offset(1, 0).Address & ":" & Cells.Find("­È").Offset(1, 0).End(xlDown).Address
    Range("D1") = "=sumif(" & abc1 & ",""BI""," & abc2 & ")"
End Sub

TOP

«D±`·PÁÂHsieh¤Îoobirdªº«ü¾É
¸Ñ¨M§xÂZ§Ú³\¤[ªº°ÝÃD¤]Åý§Ú¾Ç±o¥¿½TªºÆ[©À

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD