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
Access Form with labels can't cycle through labesl in vba code. Original labels recognized but not newly added labels.
How to recover deleted file in a shared folder.
MS Access XP Report shows no "Print Custom Size" y?
Access 2007 Slow on Subforms
How can I delete cells and still preserve the formulas in other cells?
Building a form/SubForm reference
How do I access another column of data in a ComboBox?
Certreq in Windows 2003 Server (Certificate Authority)
SBS2008 Mail delivery delays
How do I allow access to certain websites only?