Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how do I set a range's data type using VB? I wrote a vb
app to parse data into a csv file. Then I open the csv into excel and populate the columns. Now I need to set the columns to text instead of the numbers being treated like numbers. thx |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You don't
you can format a cell, but since your value is already stored there, it will have no effect. columns(1).NumberFormat = "@" formats a column as Text. To make the numbers text after the fact you would have to do With Activesheet for each cell in Intersect(.Columns(1),.UsedRange) if isnumeric(cell.Value) then cell.Value = "'" & cell.Value ' or cell.Value = "'" & cell.Text end if Next End With -- Regards, Tom Ogilvy "seanw" wrote in message ... how do I set a range's data type using VB? I wrote a vb app to parse data into a csv file. Then I open the csv into excel and populate the columns. Now I need to set the columns to text instead of the numbers being treated like numbers. thx |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Generally, if you set the format of the cells in the
worksheet to Text and then PasteSpecial Values the CSV file in, the numbers should format as if they were text. -----Original Message----- how do I set a range's data type using VB? I wrote a vb app to parse data into a csv file. Then I open the csv into excel and populate the columns. Now I need to set the columns to text instead of the numbers being treated like numbers. thx . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ODBC Driver Manager: Option type out of range | Excel Discussion (Misc queries) | |||
Excel x,y chart type x range must be re-entered each series | Charts and Charting in Excel | |||
Type mismatch in VBA LinEst function if range too large | Excel Programming | |||
Range type variable oddness | Excel Programming | |||
How to add an argument to every cell in a range containing same type formula?? | Excel Programming |