Thanks Paul. Actually I am learning on daily basis following your posts and implementing as much in my projects. I was not able to change the captions actually, so had to use two buttons. But thanks a lot. On Oct 10, 2014 7:50 PM, "Paul Schreiner" <schreiner_p...@att.net> wrote:
> What do you know of Excel and VBA? > > This is a pretty simple exercise. > Simply insert an ActiveX button. > change the Properties so that the name is: Btn_Filter. > Select "View Code" > add this to the macro: > Private Sub Btn_Filter_Click() > If (Left(UCase(Btn_Filter.Caption), 4) <> "TYPE") Then > Btn_Filter.Caption = "Type 1" > ActiveSheet.Range("$A$1:$A$10000").AutoFilter Field:=1, > Criteria1:="Type 1" > ElseIf (Btn_Filter.Caption = "Type 1") Then > Btn_Filter.Caption = "Type2" > ActiveSheet.Range("$A$1:$A$10000").AutoFilter Field:=1, > Criteria1:="Type2" > Else > Btn_Filter.Caption = "Click to Filter" > If (ActiveSheet.FilterMode) Then ActiveSheet.ShowAllData > End If > End Sub > > hope this helps > On Friday, October 10, 2014 7:10:17 AM UTC-4, simplyali wrote: > >> Dear Excel Gurus, >> >> I need one help in the attached Excel. I need a Macro Button to be placed >> on the sheet, on clicking the same it should select the option out of two. >> >> Example: >> >> When I click on the Button first time, it select Type 1 from the first >> Column, and change the Button Text to Type 2. Similarly, wen I click on teh >> Button again, It selects Type 2 from the Column and the Button Test changes >> to Type 1. >> >> Note:" I will be having only two values for the Column. >> -- >> Thanks and Regards, >> Ahmed Ali Siddique >> >> -- > Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It's > =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > 2) Don't post a question in the thread of another member. > 3) Don't post questions regarding breaking or bypassing any security > measure. > 4) Acknowledge the responses you receive, good or bad. > 5) Jobs posting is not allowed. > 6) Sharing copyrighted material and their links is not allowed. > > NOTE : Don't ever post confidential data in a workbook. Forum owners and > members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to excel-macros+unsubscr...@googlegroups.com. > To post to this group, send email to excel-macros@googlegroups.com. > Visit this group at http://groups.google.com/group/excel-macros. > For more options, visit https://groups.google.com/d/optout. > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It's =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.