Dear People,
Please Help. I have to write macro for work that would let user choose date ( thus the ListBox1),
then depending on date chosen the cells would be cleared. When I run this macro,
regardless of the date that i choose it deletes data from Jan 08 - Mar 08 at the same time.
I have try everything.
How do I modify macro so if user chooses Mar 08 only that data would be delete and
Private Sub CancelButton_Click()
Unload UserForm1
End Sub
Private Sub ListBox1_Click()
End Sub
Private Sub OKButton_Click()
If Range("AO10") = "Jan 2008" Then Range( _
"E11:E26,E30:E32,E36:E37,E41:E43,E50:E53 _
E55:E56,E59,E64:E66,E68:E71,E76,E82:E84,E86:E88,E94").Select
Selection.ClearContents
If Range("AO11") = "Feb 2008" Then Range( _
"G11:G26,G30:G32,G36:G37,G41:G43,G50:G53,G55:G56,G59,G64:G66 _
,G68:G71,G76,G82:G84,G86:G88,G94").Select
Selection.ClearContents
If Range("AO12") = "Mar 2008" Then Range( _
"I11:I26,I30:I32,I36:I37,I41:I43,I50:I53,I55:I56,I59,I64:I66,I68:I71,I76,I82:I84,I86:I88,I94").Select
Selection.ClearContents
Unload UserForm1
Please Help. I have to write macro for work that would let user choose date ( thus the ListBox1),
then depending on date chosen the cells would be cleared. When I run this macro,
regardless of the date that i choose it deletes data from Jan 08 - Mar 08 at the same time.
I have try everything.
How do I modify macro so if user chooses Mar 08 only that data would be delete and
Private Sub CancelButton_Click()
Unload UserForm1
End Sub
Private Sub ListBox1_Click()
End Sub
Private Sub OKButton_Click()
If Range("AO10") = "Jan 2008" Then Range( _
"E11:E26,E30:E32,E36:E37,E41:E43,E50:E53 _
E55:E56,E59,E64:E66,E68:E71,E76,E82:E84,E86:E88,E94").Select
Selection.ClearContents
If Range("AO11") = "Feb 2008" Then Range( _
"G11:G26,G30:G32,G36:G37,G41:G43,G50:G53,G55:G56,G59,G64:G66 _
,G68:G71,G76,G82:G84,G86:G88,G94").Select
Selection.ClearContents
If Range("AO12") = "Mar 2008" Then Range( _
"I11:I26,I30:I32,I36:I37,I41:I43,I50:I53,I55:I56,I59,I64:I66,I68:I71,I76,I82:I84,I86:I88,I94").Select
Selection.ClearContents
Unload UserForm1