ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format Columns (https://www.excelbanter.com/excel-programming/316548-format-columns.html)

Todd

Format Columns
 
Hi,

i am trying to write a macro that converts a column's format from text to
numeric with no decimal places.

Thanks

Tom Ogilvy

Format Columns
 
Columns(3).NumberFormat = "#"

But this will not affect any values that are stored as text.

Perhaps
Columns(3).NumberFormat = "#"
set rng = Range(cells(1,3),Cells(rows.count,3).end(xlup))
rng.Value = rng.Value

is what you want

--
Regards,
Tom Ogilvy

"Todd" wrote in message
...
Hi,

i am trying to write a macro that converts a column's format from text to
numeric with no decimal places.

Thanks




Martin_Austin[_3_]

Format Columns
 

I know to format a specific cell like that, you could use th
formatnumber() function. I'm new to this too, so I don't kno
specifics

--
Martin_Austi
-----------------------------------------------------------------------
Martin_Austin's Profile: http://www.excelforum.com/member.php...fo&userid=1638
View this thread: http://www.excelforum.com/showthread.php?threadid=27760



All times are GMT +1. The time now is 11:57 PM.

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