I have recently started learning a few bits and pieces with using macros nd VBA code in excel. My question is in regards to
the functions you can normally use for cells, such as SUM, SUMPRODUCT, COUNTIF etc. Can these be used in VBA to assign a
value to a variable "x", or does the code have to be related to a cell value?
here is an example of what
I am tringing to do, I have only assigned the value of "x" to B1 so I can see what the value of x is.
am used to programing with matlab so if operations like this are possible it would make the learning curve a little easier I
Dim x As Integer
'try to use countif function to determine non-zero cells
x = CountIf(Range("A4:A11"), <>0)
Range("B1").Value = x