- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 5# cslu37
¨Ì§AªþÀɤº®e©Ò¼gµ{¦¡½X
¸Õ¸Õ¬Ý- Option Explicit
- Dim Rng As Range
- Sub Ex_¤U©Ô1()
- Dim i As Integer, AR(), E As Variant
- AR = Array(¤u§@ªí2, ¤u§@ªí3)
- '***¤lµ{¦¡ªº¤è§b±¹¬I*****
- For Each E In AR '°j°é e : ¨Ì§Ç¶Ç¦^ °}¦C¤ºªº¤u§@ªíª«¥ó
- If TypeName(E) <> "Worksheet" Then MsgBox "°}¦C¤¸¯À»Ý¬O Worksheet ª«¥ó": End
- Next
- '*************************
- With Sheets("¤u§@ªí1")
- Set Rng = .Range("a3", "e" & .Range("a2").End(xlDown).Row)
- If .Range("a2").End(xlDown).Row = Rows.Count Then
- Set Rng = .Range("A3") '¤u§@ªí1©|¥¼¦³¸ê®Æ
- Rng = Date
- For i = 2 To 5 '°j°é:¨Ì§Ç¿é¤J¸ê®Æ
- '**¤£ª¾¤½¦¡¬°©M**
- Rng.Cells(1, i) = i
- Next
- Else
- '¤u§@ªí1¤w¦³¸ê®Æ , ¥Î½d³ò¤U©Ô¤èªk
- If Rng.Rows.Count = 1 Then ''**¦]¤U©Ôªº½d³ò¦C¼Æ¥u¦³¤@¦C***
- .Select
- Rng.Cells(2, 1).Activate
- MsgBox "¤U©Ôªº½d³ò¦C¼Æ¥u¦³¤@¦C" & vbLf & "½Ð¦Û¦æ¿é¤J" & Rng.Offset(1).Address & "ªº¼ÆÈ...."
- End
-
- End If
- Rng.AutoFill Destination:=Rng.Rows("1:" & Rng.Rows.Count + 1), Type:=xlFillDefault
- Set Rng = Rng.Cells(Rng.Rows.Count + 1, 1) 'AÄæ½d³ò¤º³Ì«áªº¤é´Á
- End If
- End With
- Ex_¤U©Ô2 AR '©I¥s ¤lµ{§Ç
- End Sub
- Sub Ex_¤U©Ô2(Sh As Variant) '¤lµ{§Ç »Ý¶Ç»¼°Ñ¼Æ(°}¦C(¤u§@ªíª«¥ó))
- Dim xRng As Range, AR(), E As Variant
- For Each E In Sh '°j°é e : ¨Ì§Ç¶Ç¦^ °}¦C¤ºªº¤u§@ªíª«¥ó
- If E.Name = "¤u§@ªí2" Then
- '¸ê®Æ2-3 ¸ê®Æ2-4 ¸ê®Æ2-5 ¸ê®Æ2-6 ªº¤½¦¡
- AR = Array("=rc[-2]*1+rC[-1]*1", "=rC[-3]*rC[-2]+rC[-1]", "=rC[-3]*rC[-2]-rc[-1]", "=rc[-3]+rc[-2]-rc[-1]")
- ElseIf E.Name = "¤u§@ªí3" Then
- '¸ê®Æ3-3 ¸ê®Æ3-4 ¸ê®Æ3-5 ¸ê®Æ3-6 ¸ê®Æ3-7 ¸ê®Æ3-8 'ªº¤½¦¡
- AR = Array("=rc[-2]+rc[-1]", "=rc[-1]-rc[-2]", "=rc[-2]+rc[-1]", "=rc[-2]*rc[-1]", "=rc[-2]+rc[-1]", "=rc[-2]-rc[-1]")
- Else
- MsgBox "¤u§@ªí¿ù»~ µ{¦¡Ãö³¬": End
- End If
- Set xRng = E.Range("A:A").Find(Rng.Text, LookIn:=xlValues) '´M§ä¤u§@ªí1AÄæ½d³ò¤º³Ì«áªº¤é´Á
- If xRng Is Nothing Then '¨S§ä¨ì
- Set xRng = E.Range("A" & Rows.Count).End(xlUp).Offset(1)
- '³]¬°AÄæ½d³ò¤º³Ì«áªº¤é´Áªº¤U¤@¦C¦ì
- Else
- If xRng.Range("A2") <> "" Then '§ä¨ì ¥B ¤U¤@¦C¦ì<>""
- With xRng
- Range(.Cells(2, 1), .Range("A2").End(xlToRight).End(xlDown)) = ""
- '²M°£¤U¤@¦C¦ì«áªº¸ê®Æ
- End With
- End If
- End If
- xRng.Resize(, 3).Value = Rng.Resize(, 3).Value 'µ¹¤W¤u§@ªí¤U©ÔA:Cªº¸ê®Æ
- With xRng.Cells(1, 4).Resize(, UBound(AR) + 1)
- .Cells = AR 'µ¹¤W¤u§@ªí2,¤u§@ªí3:C«á¸ê®Æªº¤½¦¡
- '***** ¦p¤W¦C µ¹¤W¤u§@ªí2,¤u§@ªí3:C«á¸ê®Æªº¤½¦¡ ¥¿½T
- .Cells = .Value '***** ¥i¥Î¤U¦C¦¹µ{¦¡½X±N³B¦s®æªº¤½¦¡ÂରÈ
- '*************************************************
- End With
- Next
- End Sub
½Æ»s¥N½X |
|