If you're doing this by hand, you can find an empty cell.
Put 100 in that cell
edit|copy that cell
select the range to fix
edit|paste special|check divide
Then clean up that helper cell (with 100 in it).
In code, it could look something like:
Option Explicit
Sub testme()
Dim myRng As Range
Dim myCell As Range
With ActiveSheet
Set myCell = .Cells.SpecialCells(xlCellTypeLastCell).Offset(1, 1)
myCell.Value = 100
Set myRng = .Range("e1", .Cells(.Rows.Count, "E").End(xlUp))
myCell.Copy
myRng.PasteSpecial operation:=xlPasteSpecialOperationDivide
myCell.Clear
End With
End Sub
(I used column E for my testing.)
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
c62ip64 wrote:
>
> I am importing a fixed length text file containing numeric data with an
> implied decimal point. I want to format the worksheet column to include the
> decimal point. E.g. text file '000012345', worksheet column '0000123.45'
>
> I can format the column as numeric to include the decimal point and divide
> the value by 100 to get the precision. I am not sure how to define the
> calculation for the column.
>
> I'm assuming that dividing by 100 is the easiest way to do this. Let me know
> if there is an easier way.
>
> Thanks,
> Tom
--
Dave Peterson
Bookmarks