How to remove extra spaces when I copied cells from Outlook email

arup1032

New Member
Joined
Mar 8, 2016
Messages
10
I watch e problem in excel regularly. I need to copy cell from Outlook email. I generally copy the cells or data from Outlook and paste it into the excel sheet. But When I paste it into the excel file, some extra space remains every time. I am attaching a sheet where I did the same. In the numbers, you will find extra space. How to remove such space at once? I usually need to do it with a large number of cells. Here I only mentioned some samples.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Here in the numbered cell, there is some space before the text. I can use text in the column for that case. But the case is not similar every time. Some cells have 4 spaces before text/number, some have 3 spaces, some have 2, etc.
 

Attachments

  • Sample Image.png
    Sample Image.png
    3.7 KB · Views: 16
Upvote 0
IF B2:B7 are numbers, in C2 copy down.

=Trim(B2)

If macro required.
VBA code:
VBA Code:
Sub Con_nums()
Range("B2:B7").Value = Evaluate("Trim(B2:B7)")
End sub
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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