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
SBS 2008 Console feature is not setup correctly - Unable to create users -
2 questions about messagequeue
call / run / execute a javascript function on a html webpage with an vb 6 activeX on the same page
Upgrading Server 2008 Evaluation Version to Fully Licensed
How to make label in vb.net visual studio 2008 Transparent
Add reference to Microsoft.SqlServer.Manage<wbr />ment not available
select the most recent date in mssql
Convert Epoch Date from Mysql to MS Access
How can I allow regular domain users update their own Active DIrectory information?
T SQL Update table.col based on several criteria