Adding VB Buttons and linking to a field on Excel.

darejack2001

New Member
Joined
Nov 3, 2011
Messages
26
Hello guys,

Below given is a snapshot of what i actually need to perform,

https://picasaweb.google.com/113572888166861387898/ExcelTips#5670678293710350690

Circled in green are three vba buttons i need to link with the 'Status' column.

When clicked on "Passed" button it should display only the rows with 'Status=Passed'

When clicked on "Failed" button it should display only the rows with 'Status=Failed'

When clicked on 'Show All' it should display all rows.(Need this button as when i click on Passed it would only show 'Passed' and then if i wish to see all rows it would be helpful if i have this button)

Also it would be very helpful if a small counter window could be linked with each of these button to show count for number of passed or failed status.

I can also use filters for the same but i need to make it more user friendly so i need this working...!!

It would be of great help if any1 of u pro's can get me a solution to it..help appreciated..thank you...!!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Just record a macro while autofiltering manually, then move the appropriate lines of code into the CommandButtons' Click event procedures.
 
Upvote 0
Thank you for your reply sir, but i am a newbie to excel so it would be of great help if u could give me steps/procedure for doing same...!!
 
Upvote 0
Also i need to protect these buttons (Passed, Failed and See All) so that no one could modify its coding structure..i tried to protect the cell under which i have this button but it eventually stop the buttons functionality...!! :(
 
Upvote 0
To count the number of visible items you can use a formula like:

=SUBTOTAL(3,G6:G13)

Expand the range reference to suit.

To protect your code go to the Visual Basic Editor, select your workbook and choose Tools|VBA Project Properties. On the Protection tab check 'Lock project for viewing', enter and confirm a password and click OK. You will need to save, close and reopen the workbook for the protection to take effect.
 
Upvote 0
Gosh...m surprised wit things that could be done with excel..u r a real pro sir..thanks a lot for ur help...!!

Can by any chance we lock the positions of these button...??
 
Upvote 0

Forum statistics

Threads
1,206,921
Messages
6,075,581
Members
446,147
Latest member
homedecortips

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top