brianfosterblack
Active Member
- Joined
- Nov 1, 2011
- Messages
- 251
I am using the following code to take the content from a userform and place it in certain cells in a spreadsheet
ActiveCell.Value = FrmSale.TextBox2
Selection.NumberFormat = "d/m/yyyy"
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = FrmSale.TextBox3
The problem I am having is that everything is just being entered into all the cells as text
Some Textboxes are dates and they must enter as dates d/m/yyyy
some are whole numbers
some are numbers which must have 2 decimal points after the number e.g 5 entered as 5.00
some are percentages which must have 2 decimal points after the number. In the textbox could be the number 100 but this must enter in the speadsheet as 100% so I guess this should also have a formula to divide by 100 if the number is being represented as a percentage.
Can someone please help with this or point me to somewhere on the internet where I can find the answers.
ActiveCell.Value = FrmSale.TextBox2
Selection.NumberFormat = "d/m/yyyy"
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = FrmSale.TextBox3
The problem I am having is that everything is just being entered into all the cells as text
Some Textboxes are dates and they must enter as dates d/m/yyyy
some are whole numbers
some are numbers which must have 2 decimal points after the number e.g 5 entered as 5.00
some are percentages which must have 2 decimal points after the number. In the textbox could be the number 100 but this must enter in the speadsheet as 100% so I guess this should also have a formula to divide by 100 if the number is being represented as a percentage.
Can someone please help with this or point me to somewhere on the internet where I can find the answers.