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

itr674

Well-known Member
Joined
Apr 10, 2002
Messages
1,786
Office Version
  1. 2016
Platform
  1. Windows
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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,688
Members
448,978
Latest member
rrauni

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