Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Olivia Towery
 
Posts: n/a
Default Creating Worksheet using Server Object

I am using the CreateObject("Excel.Application") to create a workbook from
three separate tables in a sql db. This works great and compiles three
separate sheets to one workbook. My issue is that I need the cell
formatting to be text for all entries. However the Excel spreadsheet will
take my data - 05/05 and translate to 05-May OR my data 0140 and translate
to 140.

How can I write the vbscript to format all cells to text?

--
Olivia Towery


  #2   Report Post  
Miyahn
 
Posts: n/a
Default

"Olivia Towery" wrote in message
I am using the CreateObject("Excel.Application") to create a workbook from
three separate tables in a sql db. This works great and compiles three
separate sheets to one workbook. My issue is that I need the cell
formatting to be text for all entries. However the Excel spreadsheet will
take my data - 05/05 and translate to 05-May OR my data 0140 and translate
to 140.

How can I write the vbscript to format all cells to text?


Like this.

With CreateObject("Excel.Application")
.Visible = True
With .Workbooks.Add(1).Sheets(1)
.Cells.NumberFormat = "@"
.Cells(1, 1).Formula ="05/05"
End With
End With

--
Miyahn (Masataka Miya****a) JPN
Microsoft MVP for Microsoft Office - Excel(Jan 2005 - Dec 2005)


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
Creating links to a worksheet on a network. Peter Vousden Excel Worksheet Functions 0 April 7th 05 01:17 AM
Creating links to a worksheet on a network. Peter Vousden Excel Worksheet Functions 0 April 7th 05 01:17 AM
Creating a worksheet in Spanish Kent Excel Discussion (Misc queries) 1 March 1st 05 05:16 PM
Creating new worksheet from existing ddpen Excel Discussion (Misc queries) 2 December 1st 04 10:35 PM
Using Indirect & Creating a worksheet Macro Bill Healy Excel Worksheet Functions 1 November 5th 04 10:51 AM


All times are GMT +1. The time now is 04:46 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"