finaljustice
Board Regular
- Joined
- Oct 6, 2010
- Messages
- 175
Hi there,
I am having issues when putting information back into spreadsheets from information coming from Userforms. Mainly the data i'm "pasting" back into cells are being interpreted as text when they should be numbers, even though I have tried to formatting the data before putting it back into the sheet.
Here is an example:
I would really appreciate if someone could help me figure what I have been doing wrong.
Thanks
Luis
I am having issues when putting information back into spreadsheets from information coming from Userforms. Mainly the data i'm "pasting" back into cells are being interpreted as text when they should be numbers, even though I have tried to formatting the data before putting it back into the sheet.
Here is an example:
Code:
Sub SaveSteel_2() 'saves the steeel that is about to be registered
Application.ScreenUpdating = False
'find last row occupied.
UltL = ThisWorkbook.Worksheets("Acos").Range("A" & Rows.Count).End(xlUp).Row + 1
For i = 1 To 36
If i = 1 Then
ThisWorkbook.Sheets("Acos").Range("A" & UltL).Offset(0, i - 1) = UserForm3.Controls("Textbox" & i) 'added this because the first item is the name of the steel and is text but the rest must be placed back as numbers, ergo the IF.
GoTo SkipName2
End If
ThisWorkbook.Sheets("Acos").Range("A" & UltL).Offset(0, i - 1) = Format(UserForm3.Controls("Textbox" & i), "0.00")
SkipName2:
Next
'refresh the combobox with the new steel.
UltL = ThisWorkbook.Worksheets("Acos").Range("A" & Rows.Count).End(xlUp).Row
ThisWorkbook.Sheets("Acos").Range("A3:A" & UltL).Name = "lista_acos"
UserForm1.ComboBox1.RowSource = "lista_acos"
MsgBox "Registration was successful!"
UserForm3.Hide
Application.ScreenUpdating = True
End Sub
I would really appreciate if someone could help me figure what I have been doing wrong.
Thanks
Luis