I have a question regarding string modification. Let's assume that we have the following string: 4155595208***
in cell A1 (10 numbers and 3 starts).
Now I would like to substitute these 3 stars with a blank field and get the result in cell B1 (so I want 4155595208 to get as a result). If I used a normal built-in Excel function I would type the following thing into cell B1:
=SUBSTITUTE(A1,"*","")
Now I would like to do the very same thing using Excel VBA. Whenever I tried to run the following code however, I got the error message: "Run-time error '13': Type mismatch".
sub test()
cells(1,2) = "=SUBSTITUTE(M2," * ","")"
end sub
I guess the problem might occur because of the bunch of quotation marks but I don't know. Could someone help me with this matter?
Thanks in advance,
Laszlo