Answer the question
In order to leave comments, you need to log in
How to work with formulas in Excel?
It is necessary programmatically to calculate the sum with just some formula =SUM("J2:J"&j), well, or like what variant there is, VBA looks at this formula, swears. =SUM(Above)- swears
j- last line +1
Help please, don't understand)
Answer the question
In order to leave comments, you need to log in
Add an Excel tag so more people will see the question. Also, VB from MS VS is not VBA - these are different things, you have a tag specifically for VB from MS VS, not VBA.
Sheet functions are methods of the worksheetfunction object. Here is a great article chewing on the answer to your question with examples.
And yes, you don't need to use Above, there are cells and range objects in the excel vba object model. It is convenient for me to work through cells, since the coordinates of the cells there can be specified numerically, for example, is cell B1. To shift relative to a cell, use the method on the cells and range objects. For example,Cells(1,2)
offset
Cells(1,2).offset(0,-1)
would be cell A1. There are different parameters for assigning values - Value (I use it most often), Text, Formula. Read the help for each of them. Find the best solution for you.
Try to execute the following code for a general understanding of the differences between formulas and vba code:
Cells(1,2).offset(0,-1).value=1
Cells(1,2).value=2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question