Currency format in visual basic text box
Hi,
This is probably a very silly questiong but i can't find how to solve it. I have made a form that you enter in data and it puts it into cells on a spreadsheet, some of it is a numerical amount. These amounts are then referred to in other formulas. Despite the cells being in the 'accounting' format, they still appear to be just in text, and not even me reformatting the cell will chage them to any kind of number. Is there a way of formatting the textbox, in the visual basic form, to be a number? or some piece of code to enter it as a number? The code i am currently using is as follows: Sheets("in").Range("i7").Value = net 'net' being the name of the text box that the amount is entered into. I hope someone could please help. Thanks |
Currency format in visual basic text box
Sheets("in").Range("i7").Value = Format(net.Text,"$#,##0.00")
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "James Millsted" <James wrote in message ... Hi, This is probably a very silly questiong but i can't find how to solve it. I have made a form that you enter in data and it puts it into cells on a spreadsheet, some of it is a numerical amount. These amounts are then referred to in other formulas. Despite the cells being in the 'accounting' format, they still appear to be just in text, and not even me reformatting the cell will chage them to any kind of number. Is there a way of formatting the textbox, in the visual basic form, to be a number? or some piece of code to enter it as a number? The code i am currently using is as follows: Sheets("in").Range("i7").Value = net 'net' being the name of the text box that the amount is entered into. I hope someone could please help. Thanks |
All times are GMT +1. The time now is 10:13 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com