Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Misc
Macro to run on selected sheets
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Mike H, post: 3285150"] Hi, Try this. Change this line S = "Sheet1,Sheet2,Sheet3" To the name of the sheets you DON'T want the code to run on Sub ClearStockCards() Dim Ws As Worksheet S = "Sheet1,Sheet2,Sheet3" V = Split(S, ",") For Each Ws In ThisWorkbook.Worksheets If IsError(Application.Match(Ws.Name, V, 0)) Then Ws.Range("D3,A7:A36,B8:B36").ClearContents End If Next Ws End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Misc
Macro to run on selected sheets
Top