|
-
May 6th, 2006, 06:17 PM
#1
Thread Starter
New Member
[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?
Cheers
Sean
-
May 6th, 2006, 06:36 PM
#2
Re: trim function

I moved your thread here where questions about VBA are answered.
-
May 7th, 2006, 03:45 PM
#3
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...
-
May 14th, 2006, 03:03 PM
#4
Thread Starter
New Member
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
-
May 14th, 2006, 03:33 PM
#5
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.
.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|