Hi everytime,
At the bottom of your form1 code, replace the procedure "logging" with this
Sub logging()
DoesLogSheetExist
Logheading
With Sheets("Log").Range("C65536").End(xlUp)
.Offset(1, 0) = nowtiming.Caption
.Offset(1, 1) = sheeting.Text
.Offset(1, 2) = pnl.Text
.Offset(1, 3) = pf.Text
.Offset(1, 4) = Product.Text
.Offset(1, 5) = ytd.Text
.Offset(1, 6) = mtd.Text
.Offset(1, 7) = mbudget.Text
.Offset(1, 8) = fullyear.Text
End With
End Sub
this will give the search results on the next empty row.
I'm not sure what you mean about the current year (whereabouts on the form?)
Your userform code can be greatly shortened, this makes it easier to read and debug. The first and most obvious thing to do is to get rid of all the 'selecting' as this only slows things down...
shorten all parts similar to this
Range("D4").Select
ActiveCell.FormulaR1C1 = "YTD A2005 (FC '000)"
to
Range("D4").Value = "YTD A2005 (FC '000)
shorten all parts similar to this
Columns("AP:AV").Select
Selection.EntireColumn.Hidden = True
to
Columns("AP:AV").EntireColumn.Hidden = True
shorten all parts similar to this
If mbudget.Text = "Jan 2005" Then
Columns("AX:BH").Select
Selection.EntireColumn.Hidden = True
Columns("AK:AV").Select
Selection.EntireColumn.Hidden = True
ElseIf mbudget.Text = "Feb 2005" Then
Columns("AW:AW").Select
Selection.EntireColumn.Hidden = True
Columns("AY:BH").Select
Selection.EntireColumn.Hidden = True
Columns("AK:AV").Select
Selection.EntireColumn.Hidden = True
(etc)
to
Columns("AK:BH").EntireColumn.Hidden = True
If mbudget.Text = "Jan 2005" Then
Columns(AW:AW").EntireColumn.Hidden = False
ElseIf mbudget.Text = "Feb 2005" Then
Columns(AX:AX").EntireColumn.Hidden = False
Then, directly after this above statement you have another lengthy statement that be similarly changed to
Columns("AK:BH").EntireColumn.Hidden = True
If mbudget.Text = "Jan 2005 FC" Then
Columns("AK:AK").EntireColumn.Hidden = False
ElseIf mbudget.Text = "Feb 2005 FC" Then
Columns("AL:AL").EntireColumn.Hidden = False
(etc)
HTH,
John