erasing a character in the

  • Thread starter Thread starter dstiefe
  • Start date Start date
D

dstiefe

i am using the "activecell.formula" function

when i assign it to a variable i see the "=" sign

how do i erase the = sign?

Thank you
 
i am using the "activecell.formula" function

when i assign it to a variable i see the "=" sign

how do i erase the = sign?

Thank you

When you pass it to a variable (if the variable is a string) just say
something like strFormula = Mid(Cstr(Activecell.Formula),
2,len(activecell.formula)-1) ... does that work?

Chris
 
Are you saying you want the "formula" stored in the variable, but without
its leading equal sign? If so, try this...

YourVariable = Mid(ActiveCell.Formula, 2)

Rick
 
Dim myStr as string
mystr = mid(activecell.formula,2)

The worksheet function =mid() needs more parts (the length). VBA's Mid doesn't
need that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top