Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
zero's in excel cell getting rounded off
i am using a VB routine to parse the text file and copy the data to an excel sheet.and if in text file the data is 000000000 it is getting rounded to just one 0 and i need all of them in excel, any thoughts? Private Sub cmdgo_Click() Set sap_xlapp = CreateObject("Excel.Application") 'New Excel.Application sap_xlapp.DisplayAlerts = False sap_xlapp.Workbooks.Open App.Path & "\SAP_Data.xls", , False, , , , True, , , True, False 'the excel file is now opened sap_xlapp.Worksheets(1).Activate ' the excel worksheet is now active for reading Set sap_xlws = sap_xlapp.ActiveSheet l_int_srow = 1 sap_xlws.Cells(l_int_srow, 1) = "Permanent Number" sap_xlws.Cells(l_int_srow, 2) = "Name" l_int_srow = l_int_srow + 1 cmdgo.Enabled = False Call Main 'Transformation completed so clean up resources cmdgo.Enabled = True Set sap_xlws = Nothing sap_xlapp.ActiveWorkbook.Save sap_xlapp.ActiveWorkbook.Close sap_xlapp.Quit Set sap_xlapp = Nothing End Sub as seen in the code the numberic value is getting off which is stored in variable of string type *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
zero's in excel cell getting rounded off
There is nothing in the code you show that would do this. There is nothing
in the code you show that would be considered as parsing a text file. -- Regards, Tom Ogilvy "Nasreen naqvi" wrote in message ... i am using a VB routine to parse the text file and copy the data to an excel sheet.and if in text file the data is 000000000 it is getting rounded to just one 0 and i need all of them in excel, any thoughts? Private Sub cmdgo_Click() Set sap_xlapp = CreateObject("Excel.Application") 'New Excel.Application sap_xlapp.DisplayAlerts = False sap_xlapp.Workbooks.Open App.Path & "\SAP_Data.xls", , False, , , , True, , , True, False 'the excel file is now opened sap_xlapp.Worksheets(1).Activate ' the excel worksheet is now active for reading Set sap_xlws = sap_xlapp.ActiveSheet l_int_srow = 1 sap_xlws.Cells(l_int_srow, 1) = "Permanent Number" sap_xlws.Cells(l_int_srow, 2) = "Name" l_int_srow = l_int_srow + 1 cmdgo.Enabled = False Call Main 'Transformation completed so clean up resources cmdgo.Enabled = True Set sap_xlws = Nothing sap_xlapp.ActiveWorkbook.Save sap_xlapp.ActiveWorkbook.Close sap_xlapp.Quit Set sap_xlapp = Nothing End Sub as seen in the code the numberic value is getting off which is stored in variable of string type *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
zero's in excel cell getting rounded off
Reset the number format for the required range to display
"Range".NumberFormat = "000000" "Nasreen naqvi" wrote: i am using a VB routine to parse the text file and copy the data to an excel sheet.and if in text file the data is 000000000 it is getting rounded to just one 0 and i need all of them in excel, any thoughts? Private Sub cmdgo_Click() Set sap_xlapp = CreateObject("Excel.Application") 'New Excel.Application sap_xlapp.DisplayAlerts = False sap_xlapp.Workbooks.Open App.Path & "\SAP_Data.xls", , False, , , , True, , , True, False 'the excel file is now opened sap_xlapp.Worksheets(1).Activate ' the excel worksheet is now active for reading Set sap_xlws = sap_xlapp.ActiveSheet l_int_srow = 1 sap_xlws.Cells(l_int_srow, 1) = "Permanent Number" sap_xlws.Cells(l_int_srow, 2) = "Name" l_int_srow = l_int_srow + 1 cmdgo.Enabled = False Call Main 'Transformation completed so clean up resources cmdgo.Enabled = True Set sap_xlws = Nothing sap_xlapp.ActiveWorkbook.Save sap_xlapp.ActiveWorkbook.Close sap_xlapp.Quit Set sap_xlapp = Nothing End Sub as seen in the code the numberic value is getting off which is stored in variable of string type *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding zero's to Time formated cell | Excel Worksheet Functions | |||
How do I keep 2 zero's in front of s/n in a cell | Excel Discussion (Misc queries) | |||
Need formula to have date in cell B2 rounded to first of next mont | Excel Worksheet Functions | |||
adding zero's to a text cell | Excel Worksheet Functions | |||
Cell value rounded to the tenth! | Excel Programming |