sooty8
08-20-2007, 03:41 AM
Hi All
What code would be needed to ensure that if I select a name in ListBox1 on UserForm1, the ActiveCell selected would be in the correct row of Sheet1 of the workbook, Column("I") the Calendar is named as UserForm2. the code is below. There are over 500 rows on Sheet1 and all are in ListBox1 basically I suppose Sheet1 is a database using the RowSource.
Private Sub Calendar1_Click()
Application.ScreenUpdating = False
ActiveCell.Value = Calendar1()
With ActiveCell
.NumberFormat = "dd/mm/yy"
ActiveCell.Offset(0, 1) = ComboBox2.Value
ActiveCell.Offset(0, 2) = ComboBox3.Value
ActiveCell.Offset(0, 5) = ComboBox1.Value
ActiveCell.Offset(0, 4) = ComboBox4.Value
ActiveCell.Offset(0, 3) = ComboBox5.Value
ActiveCell.Select
End With
ComboBox2.Value = ""
ComboBox3.Value = ""
ComboBox1.Value = ""
ComboBox4.Value = ""
ComboBox5.Value = ""
Application.ScreenUpdating = True
End Sub
Any help much appreciated
Sooty8:help
What code would be needed to ensure that if I select a name in ListBox1 on UserForm1, the ActiveCell selected would be in the correct row of Sheet1 of the workbook, Column("I") the Calendar is named as UserForm2. the code is below. There are over 500 rows on Sheet1 and all are in ListBox1 basically I suppose Sheet1 is a database using the RowSource.
Private Sub Calendar1_Click()
Application.ScreenUpdating = False
ActiveCell.Value = Calendar1()
With ActiveCell
.NumberFormat = "dd/mm/yy"
ActiveCell.Offset(0, 1) = ComboBox2.Value
ActiveCell.Offset(0, 2) = ComboBox3.Value
ActiveCell.Offset(0, 5) = ComboBox1.Value
ActiveCell.Offset(0, 4) = ComboBox4.Value
ActiveCell.Offset(0, 3) = ComboBox5.Value
ActiveCell.Select
End With
ComboBox2.Value = ""
ComboBox3.Value = ""
ComboBox1.Value = ""
ComboBox4.Value = ""
ComboBox5.Value = ""
Application.ScreenUpdating = True
End Sub
Any help much appreciated
Sooty8:help