Excel Macro: find certain text and delete columns

Womble6

New Member
Joined
Apr 21, 2011
Messages
1
Can anyone help me with the below.

Basically im trying to write a macro that brings up (ideally) a drop box with the 12 months of the year (in similar format to "Mar-11"), and the user selects the month they are updating (e.g. Mar-11).

Then the macro searches for that month/text in 12 set cells (will always be B2: M2), please note the cell will contain this text, as well as other text (e.g. cell will contain similar to "Mar-11 figures")

Then once the macro finds which cell contains that text (e.g. for Mar-11, would be D2), it deletes the other 11 columns (i.e. it would delete columns E:M, and columns B:C).

Would really appreciate some help on this if anyone had any ideas?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,224,524
Messages
6,179,308
Members
452,904
Latest member
CodeMasterX

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