Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Unwanted spaces

In a column, for 3400 rows, How do I get rid of an unwanted space preceding
the sentence and make sure the first letter of the sentence is capitalized.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default Unwanted spaces

This formula should do the trick.

=UPPER(LEFT(TRIM(A1)))&RIGHT(TRIM(A1),LEN(TRIM(A1) )-1)

enter it in a unused column, Copy down and then Copy-Paste Special Values
back to column A
--
If this helps, please remember to click yes.


"LeisaA" wrote:

In a column, for 3400 rows, How do I get rid of an unwanted space preceding
the sentence and make sure the first letter of the sentence is capitalized.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Unwanted spaces

THANK YOU SO MUCH! Have a great day!

"Paul C" wrote:

This formula should do the trick.

=UPPER(LEFT(TRIM(A1)))&RIGHT(TRIM(A1),LEN(TRIM(A1) )-1)

enter it in a unused column, Copy down and then Copy-Paste Special Values
back to column A
--
If this helps, please remember to click yes.


"LeisaA" wrote:

In a column, for 3400 rows, How do I get rid of an unwanted space preceding
the sentence and make sure the first letter of the sentence is capitalized.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Unwanted spaces

Assuming what you asked is all that you want to do, then give this macro a
try...

Sub FixSentences()
Dim X As Long, LastRow As Long, CellText As String
Const FirstRow As Long = 2
Const DataColumn As String = "A"
LastRow = Cells(Rows.Count, DataColumn).End(xlUp).Row
For X = FirstRow To LastRow
CellText = Cells(X, DataColumn).Value
CellText = LTrim(CellText)
Mid(CellText, 1, 1) = UCase(Left(CellText, 1))
Cells(X, DataColumn).Value = CellText
Next
End Sub

--
Rick (MVP - Excel)


"LeisaA" wrote in message
...
In a column, for 3400 rows, How do I get rid of an unwanted space
preceding
the sentence and make sure the first letter of the sentence is
capitalized.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Unwanted spaces

On Feb 16, 12:46*pm, LeisaA wrote:
In a column, for 3400 rows, How do I get rid of an unwanted space preceding
the sentence and make sure the first letter of the sentence is capitalized.



Sub test()
For Each c In Range("A2:A3400")
c.Value = Trim(c.Value)
c.Value = UCase(Left(c.Value, 1)) & Right(c.Value, Len(c.Value) -
1)
Next
End Sub
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
Unwanted spaces in merged cells ksf Excel Discussion (Misc queries) 1 April 22nd 09 03:08 AM
remove unwanted spaces? Nige Danton Excel Worksheet Functions 5 December 7th 07 01:10 PM
Deleting unwanted lead spaces throughout a worksheet Coles2020 Excel Worksheet Functions 12 September 21st 07 10:40 PM
Unwanted spaces Loren Excel Worksheet Functions 3 March 15th 07 08:24 PM
Unwanted spaces Glen Millar Excel Programming 3 May 19th 04 05:09 AM


All times are GMT +1. The time now is 02:47 PM.

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"