Home > Software engineering >  Use excel formula is good, because for a long time, how to use vb to realize automatic computing sta
Use excel formula is good, because for a long time, how to use vb to realize automatic computing sta

Time:09-17

Now use the excel formula to be cast surely,
Because for a long time, how to use vb to realize automatic computing statistics,
I am a rookie, you genuflect is begged god help!
Cast surely money excel formula:=D2 * (1 + C3) + 1000
=D3 * (1 + C4) + 1000
=D4 * (1 + C5) + 1000
Using vb to automatically calculating the

CodePudding user response:

Since the "formula", then according to the formula, the expression to calculate the result of using VB, just in written form,



How long can that simple formula, Excel calculation?
The amount of data you hard!

CodePudding user response:

Add a macro:
 
Sub test ()
Const lngLastRow As Long=100 'own definition to deal with the last line of the
Dim As Long I

For I=3 To lngLastRow 'from the third row To the last line of the definition of
ActiveSheet. Cells (I, 4)=ActiveSheet. Cells (I - 1, 4) * (1 + ActiveSheet. Cells (I, 3)) + 1000
Next
End Sub

CodePudding user response:

Test and 1400 rows, millisecond, according to the data you see enough for three or four years of data, see what concept are you slow

CodePudding user response:

Line 10000?

X=10000
Range (E3: "E" & amp; X). FormulaR1C1="=R [1] [1] C * (1 + RC [2]) + 1000"

CodePudding user response:

You use a
Both dim t
 
T=timer
'
middle codeMsgbox timer - t

Look at it
  •  Tags:  
  • VBA
  • Related