Try this macro then:

Option Explicit
Sub Add_sums()
    Dim ShtNo, nRows, R
    For ShtNo = 1 To Sheets.Count
        Sheets(ShtNo).Select
        nRows = ActiveCell.SpecialCells(xlLastCell).Row
        For R = 4 To nRows
            If (Sheets(ShtNo).Cells(R, "C").Value <> "") Then
                Sheets(ShtNo).Cells(R, "F").FormulaR1C1 = "=RC[-3]*RC[-1]"
            End If
        Next R
    Next ShtNo
End Sub
 
Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------




________________________________
From: Dilan De Silva <dila...@gmail.com>
To: excel-macros@googlegroups.com
Sent: Tue, April 10, 2012 10:27:05 AM
Subject: Re: $$Excel-Macros$$ Macro to calculate amount


Paul, 
Thank you for the reply. 
If I used your answer, I have to paste it on each cell. Paste the formula in a 
work book with more than 100 pages is time consuming.

Therefore I need to apply the formula to all cells in one click.
Thank you.
Regards,
Dilan





On Tue, Apr 10, 2012 at 5:22 PM, Paul Schreiner <schreiner_p...@att.net> wrote:

There's no macro required.
>you can use a simple formula:
>=IF(C5>0,C5*E5,"")
>then copy this down...
> 
>Paul
>-----------------------------------------
>“Do all the good you can,
>By all the means you can,
>In all the ways you can,
>In all the places you can,
>At all the times you can,
>To all the people you can,
>As long as ever you can.” - John Wesley
>-----------------------------------------
>
>
>
>
>
________________________________
From: Dilan De Silva <dila...@gmail.com>
>To: excel-macros@googlegroups.com
>Sent: Tue, April 10, 2012 9:47:29 AM
>Subject: $$Excel-Macros$$ Macro to calculate amount
>
>
>
>Dear experts, 
>
>
>I need a macro for following requirement. 
>
>
>Please refer the attached Excel sheet. If there is a value in the cell 
>C5(Quantity), formula of cell F5(Amount) should be =C5*E5 otherwise cell F5 
>should be blank.
>This should be repeat to each row which has value in Column C.
>
>
>Thank you. 
>Regards,
>Dilan -- 
>FORUM RULES (986+ members already BANNED for violation)
> 
>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
>quick attention or may not be answered.
> 
>2) Don't post a question in the thread of another member.
> 
>3) Don't post questions regarding breaking or bypassing any security measure.
> 
>4) Acknowledge the responses you receive, good or bad.
> 
>5) Cross-promotion of, or links to, forums competitive to this forum in 
>signatures are prohibited. 
>
> 
>NOTE : Don't ever post personal or confidential data in a workbook. Forum 
>owners 
>and members are not responsible for any loss.
> 
>------------------------------------------------------------------------------------------------------
>
>To post to this group, send email to excel-macros@googlegroups.com
>
>-- 
>FORUM RULES (986+ members already BANNED for violation)
> 
>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
>quick attention or may not be answered.
> 
>2) Don't post a question in the thread of another member.
> 
>3) Don't post questions regarding breaking or bypassing any security measure.
> 
>4) Acknowledge the responses you receive, good or bad.
> 
>5) Cross-promotion of, or links to, forums competitive to this forum in 
>signatures are prohibited. 
>
> 
>NOTE : Don't ever post personal or confidential data in a workbook. Forum 
>owners 
>and members are not responsible for any loss.
> 
>------------------------------------------------------------------------------------------------------
>
>To post to this group, send email to excel-macros@googlegroups.com
>
-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

 
NOTE : Don't ever post personal or confidential data in a workbook. Forum 
owners 
and members are not responsible for any loss.
 
------------------------------------------------------------------------------------------------------

To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to