-
[RESOLVED] trim function
Hi
I'm hoping somebody can help me. I'm just starting to learn about VB and am trying to write a function for Excel which will trim the cells I highlight. The idea is to have a custom button which will do this (eg clicking the bold button in Excel changes font to bold). Can anybody help? :confused:
Cheers
Sean
-
Re: trim function
http://www.vbforums.com/attachment.p...id=47243&stc=1
I moved your thread here where questions about VBA are answered.
-
Re: trim function
create a commandbutton on the sheet where you want the cells to be trimed.
paste the below mentioned code in the command button code.
make sure you highlight the cell whose value you need to trim before you click the command button. i am assuming that you know that the trim function is used for stings only.
suggestion: the best best way to learn is to let the macros do what you want to do and then amend the code ;)
hope this helps...
-
Re: trim function
Thanks, followed your advice about using a macro and it's helped me understand the code a bit better. Problem solved. :)
Cheers
Sean
-
Re: trim function
Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer. Also if someone has been particularly helpful, or even particularly unhelpful, you have the ability to affect a their forum "reputation" by rating their post.
.