Private Sub CommandButton1_Click() '增加新员工
Dim No As String
Dim Name As String
Dim Graduation As String
Dim Sex As String
Dim Nation As String
Dim Graduated As String
Dim Politicalrole As String
Dim Birthplace As String
Dim Age As String
Dim Marriage As String
Dim Health As String
Dim Place As String
Dim Department As String
Dim Condition As String
Dim Entrytime As String
Dim Workage As String
Dim Tel As String
Dim ID As String
No = TextBox1.Value
Name = TextBox2.Value
Graduation = TextBox6.Value
Sex = TextBox3.Value
Nation = TextBox4.Value
Graduated = TextBox5.Value
Politcalrole = TextBox15.Value
Birthplace = TextBox14.Value
Age = TextBox13.Value
Marriage = TextBox8.Value
Health = TextBox7.Value
Place = TextBox16.Value
Department = TextBox12.Value
Position = TextBox11.Value
Entrytime = TextBox17.Value
Workage = TextBox10.Value
Tel = TextBox9.Value
ID = TextBox18.Value
Worksheets("sheet10").Activate
Range(A65536).End(xlUp).Offset(1, 0).Activate
ActiveCell.Value = No
ActiveCell.Offset(0, 1).Value = Name
ActiveCell.Offset(0, 2).Value = Sex
ActiveCell.Offset(0, 3).Value = Birthplace
ActiveCell.Offset(0, 4).Value = Age
ActiveCell.Offset(0, 5).Value = Graduation
ActiveCell.Offset(0, 6).Value = Entrytime
ActiveCell.Offset(0, 7).Value = Workage
ActiveCell.Offset(0, 8).Value = Department
ActiveCell.Offset(0, 9).Value = Position
ActiveCell.Offset(0, 10).Value = Politicalrole
ActiveCell.Offset(0, 11).Value = Marriage
ActiveCell.Offset(0, 12).Value = Place
ActiveCell.Offset(0, 13).Value = Health
ActiveCell.Offset(0, 14).Value = Nation
ActiveCell.Offset(0, 15).Value = Graduated
ActiveCell.Offset(0, 16).Value = Tel
ActiveCell.Offset(0, 17).Value = ID
ActiveCell.Offset(1, 0).Select
End Sub
这段代码有什么问题啊。。调试显示那个Worksheets("sheet10").Activate有错误,怎么改呢?求赐教。。
Dim No As String
Dim Name As String
Dim Graduation As String
Dim Sex As String
Dim Nation As String
Dim Graduated As String
Dim Politicalrole As String
Dim Birthplace As String
Dim Age As String
Dim Marriage As String
Dim Health As String
Dim Place As String
Dim Department As String
Dim Condition As String
Dim Entrytime As String
Dim Workage As String
Dim Tel As String
Dim ID As String
No = TextBox1.Value
Name = TextBox2.Value
Graduation = TextBox6.Value
Sex = TextBox3.Value
Nation = TextBox4.Value
Graduated = TextBox5.Value
Politcalrole = TextBox15.Value
Birthplace = TextBox14.Value
Age = TextBox13.Value
Marriage = TextBox8.Value
Health = TextBox7.Value
Place = TextBox16.Value
Department = TextBox12.Value
Position = TextBox11.Value
Entrytime = TextBox17.Value
Workage = TextBox10.Value
Tel = TextBox9.Value
ID = TextBox18.Value
Worksheets("sheet10").Activate
Range(A65536).End(xlUp).Offset(1, 0).Activate
ActiveCell.Value = No
ActiveCell.Offset(0, 1).Value = Name
ActiveCell.Offset(0, 2).Value = Sex
ActiveCell.Offset(0, 3).Value = Birthplace
ActiveCell.Offset(0, 4).Value = Age
ActiveCell.Offset(0, 5).Value = Graduation
ActiveCell.Offset(0, 6).Value = Entrytime
ActiveCell.Offset(0, 7).Value = Workage
ActiveCell.Offset(0, 8).Value = Department
ActiveCell.Offset(0, 9).Value = Position
ActiveCell.Offset(0, 10).Value = Politicalrole
ActiveCell.Offset(0, 11).Value = Marriage
ActiveCell.Offset(0, 12).Value = Place
ActiveCell.Offset(0, 13).Value = Health
ActiveCell.Offset(0, 14).Value = Nation
ActiveCell.Offset(0, 15).Value = Graduated
ActiveCell.Offset(0, 16).Value = Tel
ActiveCell.Offset(0, 17).Value = ID
ActiveCell.Offset(1, 0).Select
End Sub
这段代码有什么问题啊。。调试显示那个Worksheets("sheet10").Activate有错误,怎么改呢?求赐教。。