Thread: Unwanted spaces
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
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.