hello .. hmm currently i'm working on vba in excel, apparently i use ADO to extract a table data from access to excel and it works fine. the problem is when i use the extracted data to create a chart using vba and it doesn't seem to display the data properly.. it is due to the text format when the data is extracted to excel..
how can i change it to number format when the table of data is extracted ..
Here's the code:
Dim cnt As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim stDB As String
Dim wssheet As Worksheet
Dim lnNumberOfField As Long, lnCount As Integer
Dim Target As Range
Dim Worksheet As Worksheet
Set wssheet = ThisWorkbook.Worksheets("SMS")
'wsSheet.Name = "Download"
'Application.DoubleClick
'Worksheet.Sheets("SMS").Width = 10
stDB = ThisWorkbook.path & "\" & "GSM_All.mdb"
wssheet.Range("A1").CurrentRegion.clear
cnt.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & stDB & ";"
rst.Open "SELECT * FROM Sms", cnt
lnNumberOfField = rst.Fields.Count
For lnCount = 0 To lnNumberOfField - 1
wssheet.Cells(1, lnCount + 1).Value = rst.Fields(lnCount).Name
Next lnCount
wssheet.Cells(2, 1).CopyFromRecordset rst
Sheets("SMS").Activate
'Worksheets("SMS").Visible = True
Set rst = Nothing
Set cnt = Nothing
Application.ScreenUpdating = True