Editing multiple cells at once

DMT

New Member
Joined
Jan 21, 2004
Messages
28
Here's the problem. Say I have a column of 5 numbers. They are 1000, 2000, 3000, 4000, and 5000. I want to convert these to thousands, but I don't want to make another column with a formula. I want to change those existing cells. So, basically, I would like to include /1000 to each of those cells, without going into each cell and entering the formula. Since all the cells will be edited in the same way, I'm guessing there is an easy way to apply the same change to all selected cells. Can I do this? Thanks for the help.
 

Some videos you may like

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,916
Office Version
  1. 365
Platform
  1. Windows
Simply highlight the range you want to fix and run this simple macro:

Code:
Sub FixNumbers()

    Application.ScreenUpdating = False
    
    Dim cell As Range
    For Each cell In Selection
        cell = cell / 1000
    Next cell
    
    Application.ScreenUpdating = True
    
End Sub
 

Seti

Well-known Member
Joined
May 19, 2002
Messages
2,916
You could also put 1000 in a blank cell, copy this cell, then PasteSpecial and under the Operation section choose divide. If the cells contains values, then they will be divided by 1000 and if they contain formulas, the formulas will be adjusted to show division by 1000.
 

DMT

New Member
Joined
Jan 21, 2004
Messages
28
Thanks,

Is there a way to do this without a macro? I seem to remember someone showing me a way to do it just using a certain key combination.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,916
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

See Seti's reply above for a macro-less solution.
 

Manpower

New Member
Joined
Nov 9, 2010
Messages
2
I have a similar questions, but I do not want to replace any of the data.

I have data that is exported to excel that look like dates but are text instead:
Fig.1
<TABLE style="WIDTH: 98pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=130 border=0><COLGROUP><COL style="WIDTH: 98pt; mso-width-source: userset; mso-width-alt: 4754" width=130><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl70 style="BORDER-RIGHT: #d0d7e5 0.5pt solid; BORDER-TOP: #d0d7e5 0.5pt solid; BORDER-LEFT: #d0d7e5 0.5pt solid; WIDTH: 98pt; BORDER-BOTTOM: #d0d7e5 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" width=130 height=20>11-JUL-2011</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl70 style="BORDER-RIGHT: #d0d7e5 0.5pt solid; BORDER-TOP: #d0d7e5; BORDER-LEFT: #d0d7e5 0.5pt solid; BORDER-BOTTOM: #d0d7e5 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>02-MAY-2010</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl70 style="BORDER-RIGHT: #d0d7e5 0.5pt solid; BORDER-TOP: #d0d7e5; BORDER-LEFT: #d0d7e5 0.5pt solid; BORDER-BOTTOM: #d0d7e5 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>24-APR-2011</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl70 style="BORDER-RIGHT: #d0d7e5 0.5pt solid; BORDER-TOP: #d0d7e5; BORDER-LEFT: #d0d7e5 0.5pt solid; BORDER-BOTTOM: #d0d7e5 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>04-MAY-2011</TD></TR></TBODY></TABLE>
After formatting the cells to date and specify the format to: dd-mmm-yy, it still looks like the above. When I click on the cell, hit F2 and enter, it turns the cells to the date format:
Fig. 2
<TABLE style="WIDTH: 98pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=130 border=0><COLGROUP><COL style="WIDTH: 98pt; mso-width-source: userset; mso-width-alt: 4754" width=130><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl72 style="BORDER-RIGHT: #d0d7e5 0.5pt solid; BORDER-TOP: #d0d7e5 0.5pt solid; BORDER-LEFT: #d0d7e5 0.5pt solid; WIDTH: 98pt; BORDER-BOTTOM: #d0d7e5 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" align=right width=130 height=20>11-Jul-11</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl72 style="BORDER-RIGHT: #d0d7e5 0.5pt solid; BORDER-TOP: #d0d7e5; BORDER-LEFT: #d0d7e5 0.5pt solid; BORDER-BOTTOM: #d0d7e5 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" align=right height=20>2-May-10</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl72 style="BORDER-RIGHT: #d0d7e5 0.5pt solid; BORDER-TOP: #d0d7e5; BORDER-LEFT: #d0d7e5 0.5pt solid; BORDER-BOTTOM: #d0d7e5 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" align=right height=20>24-Apr-11</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl72 style="BORDER-RIGHT: #d0d7e5 0.5pt solid; BORDER-TOP: #d0d7e5; BORDER-LEFT: #d0d7e5 0.5pt solid; BORDER-BOTTOM: #d0d7e5 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" align=right height=20>4-May-11</TD></TR></TBODY></TABLE>

Fig. 2 is what I want. I have over 1000 cells that needs to be converted, using the F2-Enter function. Is there way to edit and enter all cells at once, or create a macro to do it, without replacing the data within the cell?

The reason for needing to edit all the cells with Fig.1 to Fig.2, is because I have date formulas and it wouldn't recognize the text as dates, until it is converted manually by F2-Enter.
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,779
Office Version
  1. 2010
Platform
  1. Windows

ADVERTISEMENT

Select the column, Data > Text to columns, Finish.
 

Manpower

New Member
Joined
Nov 9, 2010
Messages
2
Awesome! That works--and soo easy. Thank you for the quick reply, shg4421
 

Watch MrExcel Video

Forum statistics

Threads
1,122,511
Messages
5,596,576
Members
414,079
Latest member
Frills

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
Top