SORT - need to restrict sort macro to active sheet that has

itr674

Well-known Member
Joined
Apr 10, 2002
Messages
1,778
Have sheets that are suffixed with DTM. I want to run the sort routine on active DTM sheet only. If DTM is not on the end of the sheet name (1) don't run the routine and (2) would like a message box to come up and tell user they can't run rountine on that paricular active sheet.

Sample sheet name Carl - DTM.
This message was edited by em on 2002-10-18 14:12
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

stevebausch

Well-known Member
Joined
May 11, 2002
Messages
810
If instr(1, activesheet.name,"DTM",vbTextCompare)> 0 then
'This is a DTM page


or


if instrrev(ActiveSheet.Name,"DTM",,vbTextCompare)= Len(ActiveSheet.Name)-2 then
'This is a DTM page
This message was edited by stevebausch on 2002-09-21 19:42
 

Forum statistics

Threads
1,144,361
Messages
5,723,905
Members
422,526
Latest member
edminty84

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
Top