ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   An easy way to delete spaces in a cell... (https://www.excelbanter.com/new-users-excel/165707-easy-way-delete-spaces-cell.html)

LEG

An easy way to delete spaces in a cell...
 
I have a list of numbers which are written with a space between each set of
numbers. Example: In cell A1 is: 12 13 14 15, in cell A2 is 23 16 17 00 and
so on.
Is there an easy way to delete all the spaces so the end result is 12131415
and 23161700? With either a formula, a macro, or a VBA module..... --
LEG

Don Guillett

An easy way to delete spaces in a cell...
 
Sub replaceblank()
For Each c In Selection
c.Value = Replace(c, " ", "")
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"LEG" wrote in message
...
I have a list of numbers which are written with a space between each set of
numbers. Example: In cell A1 is: 12 13 14 15, in cell A2 is 23 16 17 00
and
so on.
Is there an easy way to delete all the spaces so the end result is
12131415
and 23161700? With either a formula, a macro, or a VBA module..... --
LEG



LEG

An easy way to delete spaces in a cell...
 
Thanks ever so much. It worked!
--
LEG


"Don Guillett" skrev:

Sub replaceblank()
For Each c In Selection
c.Value = Replace(c, " ", "")
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"LEG" wrote in message
...
I have a list of numbers which are written with a space between each set of
numbers. Example: In cell A1 is: 12 13 14 15, in cell A2 is 23 16 17 00
and
so on.
Is there an easy way to delete all the spaces so the end result is
12131415
and 23161700? With either a formula, a macro, or a VBA module..... --
LEG




Don Guillett

An easy way to delete spaces in a cell...
 
Glad to help

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"LEG" wrote in message
...
Thanks ever so much. It worked!
--
LEG


"Don Guillett" skrev:

Sub replaceblank()
For Each c In Selection
c.Value = Replace(c, " ", "")
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"LEG" wrote in message
...
I have a list of numbers which are written with a space between each set
of
numbers. Example: In cell A1 is: 12 13 14 15, in cell A2 is 23 16 17
00
and
so on.
Is there an easy way to delete all the spaces so the end result is
12131415
and 23161700? With either a formula, a macro, or a VBA module..... --
LEG






All times are GMT +1. The time now is 08:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com