- ©«¤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
|
¦^´_ 1# alex520188 - Sub A123()
- Dim I%, J%, k%
- Dim Current As Worksheet
- For Each Current In Worksheets
- With Current
- J = .Rows(1).End(xlToRight).Column
- J = J - 1
- .Columns(J).Insert Shift:=xlToRight
- k = .Range("a:a").End(xlDown).Row
- For I = 2 To k Step 1
- .Cells(I, (J + 1)).Formula = "=IF(ISBLANK(OFFSET(0,-1)),"",OFFSET(0,-1)-OFFSET(0,-2))"
- .Cells(I, (J + 2)).Formula = "=IF(ISBLANK(OFFSET(0,-2)),"",B3+(OFFSET(0,-2)*0.001)-ROUND(RAND()*0.00005,5))"
- If .Cells(I, (J - 1)) = "" Then
- .Cells(I, J) = ""
- ElseIf .Cells(I, (J - 1)) - .Cells(I, (J - 2)) > 0 Then
- Randomize
- .Cells(I, J) = Round(((-0.1 - -0.4) * Rnd + -0.4), 1) + .Cells(I, (J - 1))
- ElseIf .Cells(I, (J - 1)) - .Cells(I, (J - 2)) < 0 Then
- Randomize
- .Cells(I, J) = Round(((0.3 - 0.1) * Rnd + 0.1), 1) + .Cells(I, (J - 1))
- End If
- Next I
- .Cells(1, J) = Now()
- MsgBox .Name
- End With
- Next
- End Sub
½Æ»s¥N½X |
|