Alpharooms
New Member
- Joined
- Oct 31, 2010
- Messages
- 7
Hi All,
Not a complete novice but not an expert eith when it comes to VB in excel, most things i have managed to do but for some reason when im posting information from a userform to a work sheet, excel freezes and has to be closed from task manager, i have stripped the codeing down to see whats cuase it to freeze but it still does it any sugegstions? i have posted the codeing below:
any suggestions as to why excel would freeze when doing this?
just trying to made things easyer at work and i seem to be getting stuck on this. this is not for profit but to keep a log on compensation and card payments ect to stop people entering n the forms wrong, any help would be good.
Thanks
Bobby
Not a complete novice but not an expert eith when it comes to VB in excel, most things i have managed to do but for some reason when im posting information from a userform to a work sheet, excel freezes and has to be closed from task manager, i have stripped the codeing down to see whats cuase it to freeze but it still does it any sugegstions? i have posted the codeing below:
Code:
Sub Add()
Sheet1.Select
Range("A3").Select
ActiveCell.EntireRow.Insert
Range("A3").Value = TextBox1.Value
Range("B3").Value = TextBox2.Value
Range("C3").Value = TextBox3.Value
Range("D3").Value = TextBox4.Value
Range("E3").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-1]-RC[-2])"
Range("F3").Value = ComboBox1.Value
Range("G3").Value = ComboBox2.Value
Sheet3.Select
UserForm1.Hide
UserForm6.Show
Exit Sub
End Sub
Private Sub CommandButton1_Click()
If TextBox2.Value = "" Then MsgBox "Please Enter Invoice ID" Else
If TextBox3.Value = "" Then MsgBox "Please Enter Amount Paid" Else
If TextBox4.Value = "" Then MsgBox "Please Enter Amount Recieved" Else
If ComboBox1.Value = "" Then MsgBox "Please Enter A Reason!" Else
If ComboBox2.Value = "" Then MsgBox "Please Enter Your Staff Initials" Else Add
Exit Sub
End Sub
any suggestions as to why excel would freeze when doing this?
just trying to made things easyer at work and i seem to be getting stuck on this. this is not for profit but to keep a log on compensation and card payments ect to stop people entering n the forms wrong, any help would be good.
Thanks
Bobby