Try this :
Sub CacluateAmount() Dim rngQuantity As Range Dim rngResult As Range Dim rngRate As Range Set rngQuantity = Application.InputBox("Please Select Range of Quantity", , , , , , , 8) Set rngRate = Application.InputBox("Please Select Range of Rate", , , , , , , 8) Set rngResult = Application.InputBox("Please Select Range For Result", , , , , , , 8) If rngResult.Cells.Count = rngQuantity.Cells.Count And rngResult.Columns.Count = 1 And rngQuantity.Columns.Count = 1 Then rngResult = Evaluate("=if(len(" & rngQuantity.Address & ")>0,(" & rngQuantity.Address & ") * " & rngRate.Address & ", """")") MsgBox "Done" Else MsgBox "Please select Correct Range, Cells are not same of give range" End If End Sub Rajan. From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of dguillett1 Sent: Apr/Tue/2012 08:09 To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ Macro to calculate amount If you REALLY need a macro, let me know. Don Guillett Microsoft MVP Excel SalesAid Software dguille...@gmail.com From: Dilan De Silva <mailto:dila...@gmail.com> Sent: Tuesday, April 10, 2012 8:47 AM To: excel-macros@googlegroups.com 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