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

[µo°Ý] ½Ð±Ð»yªk¬O­þ¸Ì¥X°ÝÃD¡H

©êºp¡I¤À¨É¤@¤U¡A§Ú·Q¥X¨Óªº»yªk¬O³o¼Ë¡Aµ²ªG¸Õ¤F¤]¨S°ÝÃD¡C
Sub Worksheet_Activate()
    '­Ó¤H¦¨ÁZ³æ¼ÐÃD¦C¡õ'
    Dim a, b, c, x, y
    a = Sheets("°ò¥»³]©w").Range("j1").Value
    b = Sheets("°ò¥»³]©w").Range("j2").Value
    c = Sheets("°ò¥»³]©w").Range("j3").Value
    d = Fix(c / 2)
    For i = 0 To d
    x = Sheets("´Á¤¤µû¶q").Range("a" & 3 + i * 2).Value
    y = Sheets("´Á¤¤µû¶q").Range("b" & 3 + i * 2).Value
    x1 = Sheets("´Á¤¤µû¶q").Range("a" & 4 + i * 2).Value
    y1 = Sheets("´Á¤¤µû¶q").Range("b" & 4 + i * 2).Value
    Sheets("´Á¤¤¦¨ÁZ³æ").Range("a" & 1 + 12 * i).Value = a & "¦~" & b & "¯Z ´Á¤¤µû¶q ¦¨ÁZ³æ" & "(" & x & ")" & y
    Sheets("´Á¤¤¦¨ÁZ³æ").Range("o" & 1 + 12 * i).Value = a & "¦~" & b & "¯Z ´Á¤¤µû¶q ¦¨ÁZ³æ" & "(" & x1 & ")" & y1
    Next i
    '­Ó¤H¦¨ÁZ³æ¼ÐÃD¦C¡ô'
End Sub

TOP

¦^´_ 21# skyutm
µ½¥Î With »P ÁY±Æ(¦¸¤@¯Å°Ï¶ô¤ºªºµ{¦¡¥ª¤è¦h´X­ÓªÅ®æ) ·|Åýµ{¦¡§ó®e©ö¾\Ū»PºûÅ@:
  1. Sub Worksheet_Activate()
  2.     '­Ó¤H¦¨ÁZ³æ¼ÐÃD¦C¡õ'
  3.     Dim a, b, c, x, y
  4.    
  5.     With Sheets("°ò¥»³]©w")
  6.       a = .Range("j1").Value
  7.       b = .Range("j2").Value
  8.       c = .Range("j3").Value
  9.     End With
  10.    
  11.     d = Fix(c / 2)
  12.    
  13.     For i = 0 To d
  14.       With Sheets("´Á¤¤µû¶q")
  15.         x = .Range("a" & 3 + i * 2).Value
  16.         y = .Range("b" & 3 + i * 2).Value
  17.         x1 = .Range("a" & 4 + i * 2).Value
  18.         y1 = .Range("b" & 4 + i * 2).Value
  19.       End With
  20.    
  21.       With Sheets("´Á¤¤¦¨ÁZ³æ")
  22.         .Range("a" & 1 + 12 * i).Value = a & "¦~" & b & "¯Z ´Á¤¤µû¶q ¦¨ÁZ³æ" & "(" & x & ")" & y
  23.         .Range("o" & 1 + 12 * i).Value = a & "¦~" & b & "¯Z ´Á¤¤µû¶q ¦¨ÁZ³æ" & "(" & x1 & ")" & y1
  24.       End With
  25.     Next i
  26.     '­Ó¤H¦¨ÁZ³æ¼ÐÃD¦C¡ô'
  27. End Sub
½Æ»s¥N½X

TOP

¦^´_ 22# luhpro


    ®¦¡IªGµM¬Ý°_¨ÓµÎªA¦h¤F

TOP

½Ð±Ð¤@¤U¡A³oºâ¬Ovbaªº»yªk¶Ü¡H¦]¬°¸Ì­±¦³¤¤¤å¦r¡H³o¬O§Ú±qvba±M®×¸ÌÀY½Æ»s¥X¨Óªº¤@³¡¥÷
Sub Worksheet_Deactivate()
     ­ì¦~¯Å = Val(Cells(12, 2))
     ·s¦~¯Å = Val(Cells(1, 18))
     Cells(12, 2) = ·s¦~¯Å
  If ·s¦~¯Å > 2 And Cells(14, 20) <> 0 Then '±j­¢3~6¦~¯Å®É,°ò¥»¤u§@ªí T14Àx¦s®æ­È¬°0
     Cells(14, 20) = 0
  End If

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-9-9 09:47 ½s¿è

¦^´_ 24# skyutm
¨S¿ù¡IÅܼƩΪ̬O¨ç¦¡¬O¥i¥H¥H¤¤¤å¦r¨Óªí²{ªº¡A Ä´¦p¡G
  1. Option Explicit
  2. Public Ar, ¹Ïªí©³¦â
  3. Public Const ¸ê®Æ¼Æ°Ï = "A8:F8"
  4. 'Public Const ¹Ïªí©³¦â = 6

  5. Private Sub Auto_Open()
  6.     Sheets("Omega").Activate
  7.     ±±¨î¶µ
  8. End Sub

  9. Private Sub Auto_Close()
  10.     Sheets("Omega").Activate
  11.     ±±¨î¶µ
  12.     ThisWorkbook.Save
  13. End Sub

  14. Private Sub ±±¨î¶µ()
  15.     ' ...........
  16. End Sub
½Æ»s¥N½X
¬O¤ñ¸û©ö©ó²M´·©öÀ´¡A¦ý¦pªG¸Óµ{¦¡¥Î©ó¨ä¥¦°ê®a¦a°ìªº¸Ü
·|³y¦¨§xÂZªº (Åܦ¨¶Ã½X)¡C

TOP

§Ú¤S¾Ç¨ì¤@©Û¤F¡A§Ú¤@ª½¥H¬°¤¤¤å¦r­n¥[""¤~¦æ¡A¤£µM¹q¸£·|¥X²{¿ù»~¡I

TOP

        ÀR«ä¦Û¦b : §g¤l¬°¥Ø¼Ð¡A¤p¤H¬°¥Øªº¡C
ªð¦^¦Cªí ¤W¤@¥DÃD