TANG009
02-05-2010, 09:17 AM
hi...i hv new problem in vba..i would like to simply my work by combo 4 worksheets to 1 worksheet. so, i decide to use combobox to choose the situation. yet, this worksheet also need to friendly use by others as well.
for an example, this month John work 32 hours in Management department, however, he retired after this month. thus, i hope i can just deleted his name on excel worksheets or change other person name other than change in vba. actually my vba code is like this,
Private Sub ComboBox1_Change()
Select Case ComboBox1.Text
Case "Management"
Case "Financial"
Set A = Cells(1, 4)
Set AA = Cells(2, 4)
If Sheets("1").Cells(10, 2) = A Then
Cells(13, 2) = "John"
End If
If Sheets("1").Cells(10, 2) = A Then
Cells(14, 2) = "Jennish"
End If
end sub
----------------------------------------------------------------------
the cells(1,4) is cell links from combo box
so when change the situation in combo box, the name of employers also will changes..i really hope that i can just change the name or deleted the person name only in worksheets but not in vba since some people will dont know how to use or look at vba code..plz gv a hand to help me solve..as i am still new in vba..tq
for an example, this month John work 32 hours in Management department, however, he retired after this month. thus, i hope i can just deleted his name on excel worksheets or change other person name other than change in vba. actually my vba code is like this,
Private Sub ComboBox1_Change()
Select Case ComboBox1.Text
Case "Management"
Case "Financial"
Set A = Cells(1, 4)
Set AA = Cells(2, 4)
If Sheets("1").Cells(10, 2) = A Then
Cells(13, 2) = "John"
End If
If Sheets("1").Cells(10, 2) = A Then
Cells(14, 2) = "Jennish"
End If
end sub
----------------------------------------------------------------------
the cells(1,4) is cell links from combo box
so when change the situation in combo box, the name of employers also will changes..i really hope that i can just change the name or deleted the person name only in worksheets but not in vba since some people will dont know how to use or look at vba code..plz gv a hand to help me solve..as i am still new in vba..tq