ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I denote values stored in columns in my macro? (https://www.excelbanter.com/excel-programming/331256-how-do-i-denote-values-stored-columns-my-macro.html)

Greg

How do I denote values stored in columns in my macro?
 
I need to write a macro that will calculate a value based on one of 2
formulas. The formula is dependent on the value in another cell. How do I
do this

Tom Ogilvy

How do I denote values stored in columns in my macro?
 
if range("A1").Value 10 then
code to use formula 1
else
code to use formula 2
End if

--
Regards,
Tom Ogilvy

"Greg" wrote in message
...
I need to write a macro that will calculate a value based on one of 2
formulas. The formula is dependent on the value in another cell. How do

I
do this




Greg

How do I denote values stored in columns in my macro?
 
I need to multiply:
C7*I7*.25
How do I code the values in C7 and I7 into the formula for K7 (the column
I'm writing a macro for?

Tom Ogilvy

How do I denote values stored in columns in my macro?
 
Range("K7").Formula = "=C7*I7*.25"

if you want to do the calculation in vba

v = Range("C7").Value * Range("I7").Value * 0.25
Range("K7").Value = v

--
Regards,
Tom Ogilvy


"Greg" wrote in message
...
I need to multiply:
C7*I7*.25
How do I code the values in C7 and I7 into the formula for K7 (the column
I'm writing a macro for?





All times are GMT +1. The time now is 05:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com