Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Software and Programs A place where you can share links to Windows applications , Adobe , Microsoft , Rapidshare , Megaupload..

Software and Programs Thread, Autofilter on month in VBA in Software & Hardware , Games; Hi Folks, Could someone help me out here. I've spent a huge amount of time trying to get my head ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=15919


Reply
LinkBack Thread Tools Display Modes
Autofilter on month in VBA
 
 
Senior Member

Reply With Quote
 
Join Date: Dec 2008
Posts: 18,122
12-01-2009, 12:50 PM
 
Hi Folks, Could someone help me out here. I've spent a huge amount of time trying to get my head around this but without any success. What I'm trying to do is to filter a worksheet for printing based on the selected month in a userform drop...

Hi Folks, Could someone help me out here. I've spent a huge amount of time trying to get my head around this but without any success.

What I'm trying to do is to filter a worksheet for printing based on the selected month in a userform drop down list. I've attached a screen capture of the two user forms used - (see "Excel Report Userform.PDF"). The first is a menu of available reports. When the Management Report is selected (button number 1) then the Report Date userform opens and the user is asked to select a reporting period.

The dates are stored as short dates in European format (dd/mm/yyyy). See attached sample "L5 Column Sample.jpg". Incidently, arrows on the column are hidden.

When the Month is selected, the index value is stored in a public variable ReportingPeriodVal. I then use a Select Case to determine the action to be taken.

Private Sub ReportPeriod_Change()

ReportingPeriodVal = ReportPeriod.ListIndex
Unload ReportDate

End Sub


Where I'm struggling is how to code the criteria for the Autofilter when the month is selected. The code below has message boxes just to test the Select Case functionality.

Select Case ReportingPeriodVal

Case 0
MsgBox " YTD: " & ReportingPeriodVal
Case 1 To 12
MsgBox "Selected Month is: " & ReportingPeriodVal
Case 13
MsgBox "Q1"
Case 14
MsgBox "Q2"
Case 15
MsgBox "Q3"
Case 16
MsgBox "Q4"
End Select


I can't attach the workbook because it contains company confidential data.

Thanks in advance
Coop

Attached Thumbnails Egypt.Com EnForum
Attached Files Egypt.Com EnForum Excel Report Userforms.pdf (20.7 KB)
 
 
 
Reply

Software and Programs Thread, Autofilter on month in VBA in Software & Hardware , Games; Hi Folks, Could someone help me out here. I've spent a huge amount of time trying to get my head ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=15919


Bookmarks

Tags
autofilter, month, vba


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump