Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Command Button & Finding/Clearing Duplicate Sheet Name

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hello,
    How do I add a command button to a worksheet (not the tool bar) and have it respond to click events?

    Also, I want my macro to check a variable (FileName) against all sheet names in workbook and return a value a could right an If statement with to exit if there is a duplicate. How would I go about this?

    Finally, I would also like to clear all sheets except "Sheets1". Is there an easy way to do this?

    Thanks a bunch for any insight,
    Luke Campbell

  2. #2
    New Member
    Join Date
    Apr 2002
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    please disregard this post. If any of you curious, I used a sheets.count variable then a loop that steps through the sheets by their item numbers, checking the names in each one, and exiting the loop when sheets.count is equal to the worksheet item number.

    Luke Campbell

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •