LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Convert to Number

Hello all,
I am using this bit of Excel Automation code in Access 2003 VBA to copy data
from one tab to another. Problem is, column A is being presented in Excel as
text. I would like column A to be converted to number via code.

Any assistance you can provide is appreciated.

20 strFile = "C:\Program Files\Database\TRANSFERS.xls"

'This will export the query to the spreadsheet. Since there is
already a Sheet1 tab,
'it will create a tab titled Sheet11
30 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"qry_List", strFile, True, "Sheet1"



150 Set objXLBook = GetObject(strFile)


' We can use the Parent
' property of the workbook object
' to get a pointer to Excel's
' Application object
160 Set objXLApp = objXLBook.Parent

170 objXLBook.Windows(1).Visible = True


180 Set obj_Sheet1 = objXLBook. _
Worksheets("Sheet1")

190 Set obj_Sheet11 = objXLBook. _
Worksheets("Sheet11")



200 LastRow = obj_Sheet11.UsedRange.Rows.Count
210 If LastRow 1 Then
220 obj_Sheet11.Range("A1:J" & LastRow).Copy


230 obj_Sheet1.Range("A1:J1").pastespecial -4163
240 obj_Sheet1.Range("A1").select


 
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
Convert a number formatted as text to a number in a macro MACRE0[_5_] Excel Programming 2 October 22nd 05 02:51 AM
how do I convert a number to number of years, months and days because Excel Worksheet Functions 2 October 12th 05 06:15 PM
convert text-format number to number in excel 2000%3f Larry Excel Discussion (Misc queries) 1 July 29th 05 08:18 PM
not able to convert text, or graphic number to regular number in e knutsenk Excel Worksheet Functions 1 April 2nd 05 08:41 AM
convert decimal number to time : convert 1,59 (minutes, dec) to m agenda9533 Excel Discussion (Misc queries) 8 January 20th 05 10:24 PM


All times are GMT +1. The time now is 05:39 AM.

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

About Us

"It's about Microsoft Excel"