ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Product calculation macro (https://www.excelbanter.com/new-users-excel/146690-product-calculation-macro.html)

MikeD1224

Product calculation macro
 
I need my macro to do a calculation in cell h3. The calculation logic should
be:

Multiply value in cell G3 by value in cell H1. This value should then show
up in cell H3. Then I need it to do the same thing for the next row
(multiply value in cell G4 by value in cell H1 and place answer in cell H4.
I need to this to fill down for all used rows.

Thanks in advance.

Mike

Bob Phillips

Product calculation macro
 

iLastRow = Cells(Rows.Count, "G").End(xlUp).Row
For i = 3 To iLatRow
Cells(i,"H).Value = Cells(i,"G").Value * Range("H1").Value
Next i

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"MikeD1224" wrote in message
...
I need my macro to do a calculation in cell h3. The calculation logic
should
be:

Multiply value in cell G3 by value in cell H1. This value should then
show
up in cell H3. Then I need it to do the same thing for the next row
(multiply value in cell G4 by value in cell H1 and place answer in cell
H4.
I need to this to fill down for all used rows.

Thanks in advance.

Mike





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

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