PDA

View Full Version : Solved: Convert entire column from General to Text



chris09q5
09-04-2009, 05:43 AM
Hi Everyone,

I am currently using the following code to convert a column to numbers and need to do a similiar thing to a different column but make it go from General to Text. The code needs to do it for all active cells in the column as the number of rows will constantly change. Can you help? Thanks!



Dim Limit As Long
Limit = ActiveSheet.UsedRange.Rows.Count
Range("M2:M" & Limit).Select
For Each Cell In Selection
Cell.Value = Val(Cell.Value)
Next
Selection.NumberFormat = "General"

mdmackillop
09-04-2009, 05:52 AM
How about

Columns("M:M").NumberFormat = "@"

chris09q5
09-04-2009, 06:15 AM
Awesome, thanks! I should've realized I didn't have to have it count the cells etc...