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

[µo°Ý] ½Ð°Ý¦bexcel¦p¦ó¬ö¿ý¬YÀx¦s®æÅܰʪº¦¸¼Æ¡H

[µo°Ý] ½Ð°Ý¦bexcel¦p¦ó¬ö¿ý¬YÀx¦s®æÅܰʪº¦¸¼Æ¡H

§Úªº·Qªk¬O¥Î
Private Sub Worksheet_Change(ByVal Target As Range)

End Sub
¦ý¬O¤£ª¾¹D¥i¤£¥i¥H¥u°w¹ï¸Óworksheet¤¤ªº¬Y­ÓÀx¦s®æ¡H
µM«á¦A³]©w¤@­ÓpublicÅܼơA¨C·íÀx¦s®æÅܰʮɡAx=x+1¡A³Ì«á¦^¶Çx

¥t¥~·Q¦A½Ð±Ð¡G
¦babc()¤¤call def(x,y)
sub def(x as integer,y as integer)

end sub
¥X²{ByRef¤Þ¼Æ«¬ºA¤£²Å¡A¸Ó¦p¦ó¸Ñ¨M¡H

·PÁÂ

·PÁª©¥D¡A°ÝÃD¤w¸g¸Ñ¨M
¤£¶i«h°h

TOP

¦^´_ 3# mnsmrtl
Åܼƫ¬ºA»Ý¬Û¦P
Sub strike()
    Dim i, j, k As Single, l As Single
    i = Round(Sheet3.Cells(2, "F") / 50, 0) * 50
    j = i Mod 100
    k = IIf(j = 0, i, (Int(i / 100) + 1) * 100)
    l = IIf(j = 0, i, Int(i / 100) * 100)
strikein k, l
End Sub
''''''''''''''''''''''''''''''
©Î¬Oµ¹ª½±µ­pºâ­È
Sub strike()
    Dim i, j
    i = Round(Sheet3.Cells(2, "F") / 50, 0) * 50
    j = i Mod 100
    strikein IIf(j = 0, i, (Int(i / 100) + 1) * 100), IIf(j = 0, i, Int(i / 100) * 100)
End Sub

¦^´_ 4#
½Ð¸Ô¬ÝVBAªº  Address »¡©ú
If Target.Address = "$H$2" Then
©Î¬O
If Target.Address(0, 0) = "H2" Then

TOP

¥t¥~·Q¦A½Ð±Ð¡A¦pªG­n§âx¿é¥X¨ìcells(14,14)
§Ú¬O³o¼Ë¼gªº
Private Sub Worksheet_Change(ByVal Target As Range)
    Static x As Integer
    If Target.Address = "H2" Then x = x + 1
    Cells(14, 14) = x
End Sub
¤£¹L¦ü¥G¦æ¤£³q
¤£¶i«h°h

TOP

·PÁª©¥DÀ°¦£¡A¦ý²Ä¤G­Ó°ÝÃDÁÙ¬O¥X²{¦P¼Ëµ²ªG
µ{¦¡½X¦p¤U¡G
Sub strike()
    Dim i, j, k, l
    i = Round(Sheet3.Cells(2, "F") / 50, 0) * 50
    j = i Mod 100
    k = IIf(j = 0, i, (Int(i / 100) + 1) * 100)
    l = IIf(j = 0, i, Int(i / 100) * 100)  
strikein k, l
End Sub
Sub strikein(x As Single, y As Single)
    Sheet3.Cells(4, "M") = x
    Sheet3.Cells(4, "N") = y   
End Sub
¨ä¤¤k©Ml¬O¦³¤p¼ÆÂIªº¡A©Ò¥HÀ³¸Ó¬O¥Îsingle¡K§a¡H
¿ù»~°T®§¤´µM¬O¤Þ¼Æ«¬ºA¤£²Å¡A¦A¦¸·PÁª©¥DÀ°¦£
¤£¶i«h°h

TOP

¦^´_ 1# mnsmrtl
http://forum.twbts.com/thread-1714-1-1.html
Private Sub Worksheet_Change(ByVal Target As Range)
  Static x
If Target.Address="$A$1" Then X=X+1
End Sub
****************
Sub abc()
def x ,y
end sub

TOP

        ÀR«ä¦Û¦b : ¥ÌÄ@°µ¡BÅw³ß¨ü¡C
ªð¦^¦Cªí ¤W¤@¥DÃD