Formatting cells

Kazdima

Board Regular
Joined
Oct 15, 2010
Messages
226
Hello everyone,
Would you please help me in formatting a cell?
I have a column A of 1500 rows. In each cell there is a Last and first names of different people. But there can be from 5 to 10 the same people with different formatting. For example, John Scott= one space between John and Scott, two, three spaces. Also, sometimes it is written as Scott James.
When I try to prepare report the same name is shown in 5 different rows instead of one, due to the problem in formatting.
Is it a way to format all cells in one manner?
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
Thank you very much in advance for your help!
<o:p> </o:p>
Dan
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi

Not sure how to accomplish what you want via the Excel format, however this do what you need via a macro or Click Event. I am sure there will be someone who can give you your exact requirements.

Code:
Private Sub spacerbtn_Click()
 
Application.ScreenUpdating = False

For Each spacer In Range("a1:a1500")

If spacer > "" Then
        Cells.Replace What:="   ", Replacement:=" ", LookAt:=xlPart, SearchOrder _
        :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
        Cells.Replace What:="  ", Replacement:=" ", LookAt:=xlPart, SearchOrder _
        :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
End If
Next spacer

Application.ScreenUpdating = True
 
 
End Sub


regards
 
Upvote 0
Hello Saltkev,

Thank you for your help.

Yes, I hope that somebody else also will try to reselve my issue with Excel formatting.

Dan
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top