Hey All,
I've created a super quality system for my company. A userform with comboboxes dicates where to dump the data from comboboxes and a text box using MATCH for r & c (row, column!)
I originally planned to create 5 userforms for each of the 5 weeks in a month so each userform would dump the data on their respective sheets... Week 1, Week 2 etc. I've just done this and noticed a file size of 23mb... eek!!!
So my question..... here is the code I'm using and I've added a new combobox (combobox8) to represent Week 1, Week 2 etc..... Is there anyway I could add a 3rd argument so it uses MATCH to match the Sheet from (box8) the Row from (box1) and the Column from (box2)... and dump the data accordingly?!
Any help really really appreciated on this..... thanx in advance!!
Code:
Option Explicit
Dim r As Long 'row number
Dim c As Integer 'column number
Private Sub ComboBox1_Change()
r = WorksheetFunction.Match(ComboBox1.Value, Worksheets("Week 1").Range("c:c"), False)
End Sub
Private Sub ComboBox2_Change()
c = WorksheetFunction.Match(ComboBox2.Value, Worksheets("Week 1").Range("4:4"), False)
End Sub
Private Sub ComboBox3_Change()
End Sub
Private Sub ComboBox5_Change()
End Sub
Private Sub CommandButton2_Click()
With Worksheets("Week 1")
.Cells(r, c).Value = TextBox1.Text
.Cells(r, c + 1).Value = ComboBox3.Text
.Cells(r, c + 2).Value = ComboBox4.Text
.Cells(r, c + 3).Value = ComboBox5.Text
.Cells(r, c + 4).Value = ComboBox6.Text
ComboBox4.Value = ""
ComboBox5.Value = ""
ComboBox6.Value = ""
ComboBox3.Value = ""
ComboBox1.Value = "-"
ComboBox2.Value = "-"
ComboBox7.Value = ""
TextBox1.Value = ""
UserForm1.Hide
UserForm6.Show
End With
End Sub
Private Sub CommandButton3_Click()
UserForm1.Hide
End Sub
Bookmarks