How do I convert spreadsheet into proper format?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to convert my text into proper format all at one time so I don't
have to do each cell individually. Can anyone help me?
 
one way to try
Sub makeproper()
With ActiveSheet.UsedRange
..Value = Application.Proper(.Value)
End With
End Sub
 
if you have formulas, use this instead or you will wipe out the formulas
Sub makeproper()
With ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants)
..Value = Application.Proper(.Value)
End With
End Sub
 
If the range that has the constants is multi-area, then this gives xl2002
problems (xl2k and up, IIRC, ok in xl97).

I think I'd go through each area:

Option Explicit
Sub testme01()

Dim myArea As Range
Dim myRng As Range

With ActiveSheet
Set myRng = Nothing
On Error Resume Next
Set myRng = .UsedRange.SpecialCells(xlCellTypeConstants)
On Error GoTo 0
If myRng Is Nothing Then
MsgBox "no constants"
Else
For Each myArea In myRng.Areas
With myArea
.Value = Application.Proper(.Value)
End With
Next myArea
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top