Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DPM DPM is offline
external usenet poster
 
Posts: 5
Default How to format cells of a column as text programmetically

Hi,

I have got an excel with data and need to import the data into a DBF.
Therefore I use the ODBC drivers and the DBF gets created.

But found the following problem,

When data was entered into the excel initallly, the column was not formated
text and remains in general format.
Thereafter values were entered such as,
123
45.l00
1/2

Before importing using ODBC I format the entire column as Text
programmetically.
But eventhough the resulting DBF gets 0, as induvidual cells in the excel
does not get formatted, even the column is formatted.
Noticed that manually if you goto each cell in the excel and just enter, the
value gets formatted into Text and thereafter gets imported properly using
ODBC.

Could someone please advice how to format each cell in the column, to Text
programmetically, which converts the data to text.
So that data is proper when the DBF is created using ODBC.

Note:
SaveAs() of Excel2003 works fine. Excel2007 does not have SaveAs() therefore
ODBC is used above.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default How to format cells of a column as text programmetically

Selection.NumberFormat = "@"

"DPM" wrote:

Hi,

I have got an excel with data and need to import the data into a DBF.
Therefore I use the ODBC drivers and the DBF gets created.

But found the following problem,

When data was entered into the excel initallly, the column was not formated
text and remains in general format.
Thereafter values were entered such as,
123
45.l00
1/2

Before importing using ODBC I format the entire column as Text
programmetically.
But eventhough the resulting DBF gets 0, as induvidual cells in the excel
does not get formatted, even the column is formatted.
Noticed that manually if you goto each cell in the excel and just enter, the
value gets formatted into Text and thereafter gets imported properly using
ODBC.

Could someone please advice how to format each cell in the column, to Text
programmetically, which converts the data to text.
So that data is proper when the DBF is created using ODBC.

Note:
SaveAs() of Excel2003 works fine. Excel2007 does not have SaveAs() therefore
ODBC is used above.



  #3   Report Post  
Posted to microsoft.public.excel.programming
DPM DPM is offline
external usenet poster
 
Posts: 5
Default How to format cells of a column as text programmetically

Hi,

Even formatting the column or each cell with .NumberFormat = "@" formats the
cell but does not convert the value.
Already entered numbers remains as it is, does not get converted to number
beginning with a ' or with the mark towards the left top of the cell.

Anyother suggestions please


"filo666" wrote in message
...
Selection.NumberFormat = "@"

"DPM" wrote:

Hi,

I have got an excel with data and need to import the data into a DBF.
Therefore I use the ODBC drivers and the DBF gets created.

But found the following problem,

When data was entered into the excel initallly, the column was not
formated
text and remains in general format.
Thereafter values were entered such as,
123
45.l00
1/2

Before importing using ODBC I format the entire column as Text
programmetically.
But eventhough the resulting DBF gets 0, as induvidual cells in the excel
does not get formatted, even the column is formatted.
Noticed that manually if you goto each cell in the excel and just enter,
the
value gets formatted into Text and thereafter gets imported properly
using
ODBC.

Could someone please advice how to format each cell in the column, to
Text
programmetically, which converts the data to text.
So that data is proper when the DBF is created using ODBC.

Note:
SaveAs() of Excel2003 works fine. Excel2007 does not have SaveAs()
therefore
ODBC is used above.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
format cells in one column based on value in another column SuzyQ New Users to Excel 3 July 19th 09 03:33 AM
Display cells(text) in one column based on cells which are present inother column [email protected] Excel Discussion (Misc queries) 1 May 12th 08 01:40 PM
format column to text [email protected] Excel Programming 2 September 19th 05 04:07 AM
Column format as Text Bruce Roberson[_5_] Excel Programming 3 February 14th 04 02:08 AM
column format as text Sumesh[_2_] Excel Programming 2 February 9th 04 01:38 PM


All times are GMT +1. The time now is 02:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"