Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
I not sure why the below code is not adding my userform entries to the spreadsheet. I did a CompileVBAProject test and there were no issues. I stepped through the program and no error messages appeared. What this program is suppose to do is it will find the final row with a value in it and add one to find the first empty row. Then it will make it the Selected ActiveCell if it is empty.
Starting with that cell, it will start adding values to the spreadsheet from the userform or it supposed to add values but it doesn't. Thank You
Starting with that cell, it will start adding values to the spreadsheet from the userform or it supposed to add values but it doesn't. Thank You
Code:
Private Sub cmdbtnAddItem_Click()
Dim FinalRow As Integer, x As Integer
Worksheets("IMA").Select
FinalRow = Cells(Rows.Count, 2).End(xlUp).Row
x = FinalRow + 1
Cells(x, 2).Select
If Cells(x, 2).Value = "" Then
ActiveCell.Select
Else
Selection.End(xlUp).Offset(1, 0).Row
End If
ActiveCell.Offset(x, 2).Value = frmAddProduct.txtbxPrdctCde.Value
ActiveCell.Offset(x, 3).Value = frmAddProduct.txtbxDescription.Value
ActiveCell.Offset(x, 4).Value = Me.txtbxDzPrCs.Value
ActiveCell.Offset(x, 5).Value = Me.txtbxCsPerPal.Value
ActiveCell.Offset(x, 7).Value = Me.txtbxStckNum.Value
End Sub