PC Review


Reply
Thread Tools Rate Thread

TRIM function

 
 
=?Utf-8?B?Zml0b3VfbGVhcm4=?=
Guest
Posts: n/a
 
      12th Jun 2007
Is it possible to trim an entire worksheet?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      12th Jun 2007
You could use a macro

Sub trimall()
Application.ScreenUpdating = False
Dim myRange As Range
Set myRange = Range("A11000") '< Change to suit
For Each c In myRange
c.Select
c.Value = Trim(c.Value)
Next c
Application.ScreenUpdating = True
End Sub

Mike

"fitou_learn" wrote:

> Is it possible to trim an entire worksheet?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Zml0b3VfbGVhcm4=?=
Guest
Posts: n/a
 
      12th Jun 2007
Many thanks Mike. It worked a treat!

"Mike H" wrote:

> You could use a macro
>
> Sub trimall()
> Application.ScreenUpdating = False
> Dim myRange As Range
> Set myRange = Range("A11000") '< Change to suit
> For Each c In myRange
> c.Select
> c.Value = Trim(c.Value)
> Next c
> Application.ScreenUpdating = True
> End Sub
>
> Mike
>
> "fitou_learn" wrote:
>
> > Is it possible to trim an entire worksheet?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trim or trim$ what is the difference =?Utf-8?B?bXV6YWZmZXI=?= Microsoft Access VBA Modules 1 19th Aug 2005 08:47 AM
Difference between Trim function and Trim member Sascha Herpers Microsoft VB .NET 8 7th Apr 2005 08:57 PM
VBA Trim and Application.worksheetfunction.Trim Hari Prasadh Microsoft Excel Programming 3 19th Jan 2005 03:22 PM
Re: Trim like worksheet Trim Bob Phillips Microsoft Excel Programming 0 20th Aug 2003 07:10 PM
Re: Difference between trim and trim$ Albert D. Kallal Microsoft Access VBA Modules 0 29th Jun 2003 01:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:13 AM.