ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using formulas in VBA (https://www.excelbanter.com/excel-programming/299665-using-formulas-vba.html)

Kevin

Using formulas in VBA
 
Hi i am having trouble putting this formula in my code any idea where i have gone wrong

Cells(intRowCount + 1, 4) = WorksheetFunction.Substitute(Substitute(A4, "Total Amount - ", ""), " USD [Mln]", "") *

Pls hel


Frank Kabel

Using formulas in VBA
 
Hi
try replacing
A4
with
Range("A4")

--
Regards
Frank Kabel
Frankfurt, Germany

"Kevin" schrieb im Newsbeitrag
...
Hi i am having trouble putting this formula in my code any idea where

i have gone wrong?

Cells(intRowCount + 1, 4) =

WorksheetFunction.Substitute(Substitute(A4, "Total Amount - ", ""), "
USD [Mln]", "") * 1

Pls help



Bernie Deitrick

Using formulas in VBA
 
Kevin,

Cells(intRowCount + 1, 4).Value =
Application.WorksheetFunction.Substitute(Applicati on.WorksheetFunction.Subst
itute(Range("A4").Value, "Total Amount - ", ""), " USD [Mln]", "") * 1

or you can use VBA's Replace function instead of the Substitute
worksheetfunction.

HTH,
Bernie
MS Excel MVP

"Kevin" wrote in message
...
Hi i am having trouble putting this formula in my code any idea where i

have gone wrong?

Cells(intRowCount + 1, 4) = WorksheetFunction.Substitute(Substitute(A4,

"Total Amount - ", ""), " USD [Mln]", "") * 1

Pls help





All times are GMT +1. The time now is 01:35 PM.

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