+ Reply to Thread
Results 1 to 8 of 8

If sheets has already name than show msgbox

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    If sheets has already name than show msgbox

    hello
    i want if there is already sheet with name of C7.value than pop up a msgbox with yes or no option
    thanx
    code is here :
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: If sheets has already name than show msgbox

    Hi tehre,

    nothing more,mothing less than looping through all sheets:

    Please Login or Register  to view this content.
    Regards
    Miroslav R.

    (If You like my solutions, feel free to add reputation.)

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: If sheets has already name than show msgbox

    its not working

  4. #4
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: If sheets has already name than show msgbox

    It was only a suggestion,not a real example. To make it work properly I have to know in which part of your code it has to be written. And the most efficient way is to upload sample workbook

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: If sheets has already name than show msgbox

    You don't need to loop through each worksheet to see if a sheet exists. Something like this will do that. However it is hard to tell what the OP wants beyond his initial question. Maybe this:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: If sheets has already name than show msgbox

    hello stnkynts

    u have reverse ur code, because according to Range("C7"). if C7.VALUE = 18 and i run code than code create a sheet with name 18, now if i click again than its also creating a file with name sheet1, sheet2, sheet3............

    check ur code

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: If sheets has already name than show msgbox

    Hi, haroon2015,

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  8. #8
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: If sheets has already name than show msgbox

    Hello Holger

    thanx a lot, Simply Just Awesome

    will add u reputation

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] how to add counter in msgbox to show remain times the message will show vba code
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-25-2013, 06:46 AM
  2. [SOLVED] Only show msgbox once
    By shiftyspina in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2013, 11:25 AM
  3. Msgbox show selection
    By sgp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2012, 10:05 AM
  4. How MsgBox can show address?
    By Milind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2005, 09:05 PM
  5. show msgbox for 5 seconds
    By jocke in forum Excel General
    Replies: 0
    Last Post: 02-02-2005, 03:08 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1