Currency format in visual basic text box

G

Guest

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
 
B

Bob Phillips

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)
 
G

Guest

Thanks very much!

Bob Phillips said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top