Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4
Default TRIM function

Is it possible to trim an entire worksheet?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,501
Default TRIM function

You could use a macro

Sub trimall()
Application.ScreenUpdating = False
Dim myRange As Range
Set myRange = Range("A1:D1000") '< 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?

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4
Default TRIM function

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("A1:D1000") '< 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
trim function [email protected] Excel Worksheet Functions 3 December 30th 05 03:00 AM
Need help with TRIM function Phil Excel Worksheet Functions 9 October 21st 05 08:02 PM
Trim Function Steved Excel Worksheet Functions 5 August 4th 05 11:06 PM
Trim function aehan Excel Worksheet Functions 3 January 25th 05 12:31 PM
How to use TRIM function Sky Warren Excel Worksheet Functions 3 January 8th 05 05:06 PM


All times are GMT +1. The time now is 10:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"