Link to home
Start Free TrialLog in
Avatar of brothertruffle880
brothertruffle880Flag for United States of America

asked on

excel 2013 substitute function

I would like to take all instances of the colon ":" in cell A1 and replace it with nothing. Not even a space.
SOLUTION
Avatar of John
John
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brothertruffle880

ASKER

Apologies John:
 I meant to edit the question and EE blocked me.  
Here's the rest of my request.
I want to get rid of the colon in my VBA code so that I can name my active sheet with the time of day.

Sub NameWorksheetByDated()
    Range("A1").Select
    Selection.Formula = "=text(now(),""mmmm dd, yyyy hh:mm:ss"")"
' the line below is not working!
    Selection.Formula = "=substitute(A1,':')"
    Selection.Copy
    Paste
    ActiveSheet.Name = Range("A1").Value
    Range("A1").Value = ""
    Application.CutCopyMode = False
End Sub
I do not use VBA so I will have to let someone else take over, however it appears you need something after ';' in the line Selection.Formula.
SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Pleased to help, but I really cannot understand why you need to use a formula