FranktheBank
Member
Hello again,
I have the below code, which is supposed to take input provided from the user in ComboBox1 'RC_Numbers', ComboBox2 'RC_Name' and Textbox 'Expense' and put them starting in Row 2 in Columns 27, 28 & 29.
It put things in the right place, but somehow 'RC_Name' goes into Columns 27 & 28??
ComboBox1 and ComboBox2 work so that you can pick from either and it populates the other
This programming is all in the Forms.
Any and all help is appreciated.
I have the below code, which is supposed to take input provided from the user in ComboBox1 'RC_Numbers', ComboBox2 'RC_Name' and Textbox 'Expense' and put them starting in Row 2 in Columns 27, 28 & 29.
It put things in the right place, but somehow 'RC_Name' goes into Columns 27 & 28??
ComboBox1 and ComboBox2 work so that you can pick from either and it populates the other
This programming is all in the Forms.
Any and all help is appreciated.
Code:
Private Sub CancelButton_Click()
Unload Me
End Sub
Private Sub CommandButton1_Click()
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Master")
If BundleCount.Value > 1 Then
lCol = lCol + BundleCount.Value + 1
End If
lRow = ws.Cells(Rows.Count, 27).End(xlUp).Offset(1, 26).Row
With ws
.Cells(lRow, 27).Value = Me.RC_Numbers.Value
.Cells(lRow, 28).Value = Me.RC_Name.Value
.Cells(lRow, 29).Value = Me.Expense.Value
End With
RC_Numbers.ListIndex = -1
RC_Name.ListIndex = -1
Expense.Object.Value = ""
End Sub
Private Sub CommandButton3_Click()
RC_Numbers.ListIndex = -1
RC_Name.ListIndex = -1
Expense.Object.Value = ""
End Sub
Private Sub Label1_Click()
.HorizontalAlignment
End Sub
Private Sub NewBundle_Click()
Dim lCol As Long
lCol = 27
BundleCount.Value = BundleCount.Value + 1
End Sub
Private Sub RC_Name_Change()
If Len(RC_Name.Text) <> 0 Then
RC_Numbers.Value = RC_Name.Text
End If
End Sub
Private Sub RC_Numbers_Change()
If Len(RC_Numbers.Value) > 0 Then
RC_Name.Text = RC_Numbers.Value
End If
End Sub
Private Sub SpinButton1_Change()
BundleCount.Value = SpinButton1.Value
End Sub
[CODE]