0
votes

I have an excel file, In the first sheet it has data like total count with status active is 59 rows status obsolete 10 rows.
In the second sheet with 59 records with status column like ACTIVE AND OBSOLETE.

I want to create a macro to select records by clicking a button it has to filter records ACTIVE or OBSOLETE using VBA.

1
So, what's the question? And why the non-specific title? Who on Earth upvoted this?! -1Jean-François Corbett

1 Answers

1
votes

One way to auto generate the VBA code is to record a macro of the steps you would take to do this if you were just working directly in the workbook. After you have the macro recorded you can look at the VBA code generated by the macro and modify as necessary.

To record a new macro:

  • Go to the View Tab then Macros then Record Macro.

To view the macro VBA code:

  • Go to the View Tab then Macros then View Macros then select the macro you want to view and click edit.

Hope this help you get started.

Enjoy!