follow upd question command button

  • Thread starter Thread starter singkit
  • Start date Start date
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!
 
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
 
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





.
 
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
 
Back
Top