Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formatting a column - needs refresh?
Hi,
I am exporting stuff out from a vb program to a .csv file, then optionally opening this in excel for the user to view. One of the columns of information contains phone numbers, but when excel opens the file it sees it as a number and shows it wrong. i.e. 447768123456 comes out as 4.47769E+11. I have put the following line in my code: .Columns(2).Select .Selection.NumberFormat = "@" which works, except for the cell to refresh to look correct I need to click on the (correctly displayed) number in the formula bar at the top of the screen, at which point the number displayed in the cell appears correctly. How can I automate this step? Thanks, James. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formatting a column - needs refresh?
Try this instead...
Columns(2).Select Selection.NumberFormat = "# -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formatting a column - needs refresh?
with Columns(2)
.NumberFormat = "000000000000" .Autofit End With -- Regards, Tom Ogilvy "James" wrote in message ... Hi, I am exporting stuff out from a vb program to a .csv file, then optionally opening this in excel for the user to view. One of the columns of information contains phone numbers, but when excel opens the file it sees it as a number and shows it wrong. i.e. 447768123456 comes out as 4.47769E+11. I have put the following line in my code: .Columns(2).Select .Selection.NumberFormat = "@" which works, except for the cell to refresh to look correct I need to click on the (correctly displayed) number in the formula bar at the top of the screen, at which point the number displayed in the cell appears correctly. How can I automate this step? Thanks, James. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formatting a column - needs refresh?
"Tom Ogilvy" wrote in message ... with Columns(2) .NumberFormat = "000000000000" .Autofit End With Thanks for the help folks, all working now! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I refresh a column after changing the formatting? | Excel Worksheet Functions | |||
Conditional Formatting - Date Refresh | Excel Worksheet Functions | |||
Maintain pivot table formatting after refresh | Excel Discussion (Misc queries) | |||
formatting on a pivot report refresh | Excel Discussion (Misc queries) | |||
Retain PivotTable formatting after "Refresh Data" | Excel Discussion (Misc queries) |