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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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,215,219
Messages
6,123,688
Members
449,117
Latest member
Aaagu

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