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
Windows Script Control component
Dynamics CRM 4.0 Edit an active contract
Colors in Excel are randomly changing
sql server agent email job notification in sql server management studio
Microsoft Word can't find the DVZAddin.dll file and Excel can't find DVZXLAddin.dll File?
Foxpro 2.6a for Windows under XP Virtual Machine
Can't start SQL Server Agent (SQLEXPRESS)
Access: 2 subreports. Start a new page if second one to big
cleaning registry from nav, symantec, and mcafee
How do I import data (number values) into access with multiple decimal places, i.e., 64.01.01?