LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Help with my macro for two autofilters

I've written this macro to ask for input and then autofilter two columns
based on that input. The first part works fine but the second part steps on
the first autofilter. Would one of you gurus mind taking a look at my code
and let me know what's wrong? I'm thinking there must be one simple piece of
code that I'm missing.

Thanks!

Randy

Option Compare Text

Private Sub Workbook_Open()

Dim P As String
Dim B As String

B = ("")

P = InputBox("Please enter the size of your project: S for Small, M for
Medium, L for Large or Cancel for All.")


10 If (P) = "l" Or (P) = "m" Or (P) = "s" Then
Columns("C:C").Select
Selection.AutoFilter Field:=1, Criteria1:=(P)

Else: If (P) = "" Then GoTo 99
If (P) < "" Then
P = InputBox("Please enter a valid selection: S for Small, M
for Medium, L for Large or Cancel for All.")
GoTo 10
End If
End If

If (P) = "l" Or (P) = "m" Then
A = MsgBox("Is there a CIR for this project?", _
vbYesNo)

If A = vbNo Then
Columns("D:D").Select
Selection.AutoFilter Field:=1, Criteria1:=(B)

Else: GoTo 99
End If
End If

99 End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro that AutoFilters based on Cell value Al Excel Programming 3 August 18th 06 10:38 PM
AutoFilters Joli Excel Worksheet Functions 1 March 21st 06 09:14 PM
How to set up AutoFilters? MS Suzanne Excel Worksheet Functions 1 June 30th 05 03:53 AM
VBA and Autofilters Frank Haverkamp Excel Programming 2 January 10th 04 01:53 AM
Userforms and autofilters - Autofilters don't seen to work with userform No Name Excel Programming 3 August 28th 03 05:42 PM


All times are GMT +1. The time now is 09:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"