follow upd question command button

S

singkit

For example on my sheet I have 1000 nuclear power
company, 3000 oil company etc

How to assign in each button. If I click button 1 for
example it should appear only nuclear and button 2 should
appear only oil company.

Thanks!
 
P

Peo Sjoblom

Apply data>filter>autofilter, record a macro while filtering for nuclear,
stop the macro. Reset the filter, record a new macro for oil.
Now drag a button from the forms toolbar to your sheet and assign the first
macro,
repeat for the second

--
For everyone's benefit keep the discussion in the newsgroup.

Regards,

Peo Sjoblom
 
S

singkit

can you give sample of maco program.
Thanks!
-----Original Message-----
Apply data>filter>autofilter, record a macro while filtering for nuclear,
stop the macro. Reset the filter, record a new macro for oil.
Now drag a button from the forms toolbar to your sheet and assign the first
macro,
repeat for the second

--
For everyone's benefit keep the discussion in the newsgroup.

Regards,

Peo Sjoblom





.
 
G

Gord Dibben

singkit

Using the macro recorder........

Sub Macro1()
Columns("A:A").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="nuclear"
End Sub

Your search criterion "nuclear" could differ. Is there any common word or
phrase that could be substituted?

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top