Microsoft
Software
Hardware
Network
Question : VBA formatting errors!
Hi Experts:
I am trying to send data from my excel to a formatted text(flat) file,in one column i have decimal values which are not going to the flat file
eg: if the value in the spreadsheet is 100.00 in the flat file i am seeing: 100
my code is below,can someone guide:
CashTicketReport = FreeFile() ------> sends data to flat file
CashTicketReportline = " "
headercell.Offset(IndexRow
, 3).NumberFormat = "0.00" -> formats datato decimal
RawCashAdjustmentAmount = headercell.Offset(IndexRow
, 3).Value
CashAdjustmentAmount = Format(Left$(RawCashAdjust
mentAmount
, 20), "@@@@@@@@@@@@@@@@@@@@")
CashTicketReportline = CashTicketReportline & CashAdjustmentAmount ->send to ff
Answer : VBA formatting errors!
Try changing..
RawCashAdjustmentAmount = headercell.Offset(IndexRow
, 3).Value
to
RawCashAdjustmentAmount = headercell.Offset(IndexRow
, 3).text
- If you use .value excel will pass the value without the formatting
Random Solutions
Microsoft has encountered a problem and needs to close.
How do I add missing Active X controls to non-admin accounts in Microsoft Access 2003?
Copy NTFS permissions to sharepoint
Formula to calculate due dates
Insert formula to range
Pivot table Field settings not preserved
Users whose usernames contain # cannot access OWA 404 error after authentication.
VB.Net 2005 - FileListBox, DriveListBox, DirectoryListBox Controls Question?
User tasks information
Windows Disk Diagnostic detected a S.M.A.R.T. fault on disk