+ Reply to Thread
Results 1 to 26 of 26

Code Clean-Up: Delete "False" worksheet created when "Cancel" is chosen in Input Box

Hybrid View

Kenny Blackwell Code Clean-Up: Delete "False"... 08-27-2015, 09:39 AM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 10:32 AM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-27-2015, 10:36 AM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 10:45 AM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-27-2015, 10:52 AM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 11:09 AM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-27-2015, 11:17 AM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 11:41 AM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-27-2015, 12:00 PM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 12:40 PM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-27-2015, 01:13 PM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 01:49 PM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-27-2015, 02:01 PM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 02:15 PM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 02:33 PM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-27-2015, 03:28 PM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 03:33 PM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-27-2015, 03:37 PM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 03:51 PM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-27-2015, 03:55 PM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 04:33 PM
gmr4evr1 Re: Code Clean-Up: Delete... 08-27-2015, 06:46 PM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-28-2015, 08:06 AM
gmr4evr1 Re: Code Clean-Up: Delete... 08-28-2015, 02:35 PM
Kenny Blackwell Re: Code Clean-Up: Delete... 08-31-2015, 07:37 AM
gmr4evr1 Re: Code Clean-Up: Delete... 08-31-2015, 10:00 AM
  1. #1
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Code Clean-Up: Delete "False" worksheet created when "Cancel" is chosen in Input Box

    That would be
    Sheets("SheetNameHere").Activate
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  2. #2
    Registered User
    Join Date
    03-30-2015
    Location
    Charlotte, NC
    MS-Off Ver
    2013
    Posts
    27

    Re: Code Clean-Up: Delete "False" worksheet created when "Cancel" is chosen in Input Box

    If I'm not mistaken, that will activate the "Home" sheet whether they create a new worksheet or not, right? If I'm correct, I only want it to remain on the "Home" sheet if they cancel the Input Box for a new asset. Here's what my code now looks like. I apologize for posting incorrectly the first time. It's been a while since I've been on here. I'm also attempting to attach a screenshot so you can get a visual of this workbook. It ends up being several worksheets, all summarized on the "Home" sheet. If they select Cancel on the Input Box, I want them to stay right there on the Home sheet. By the way, this workbook supports multiple ongoing projects in the TX area, so extra thanks for the help!

    ScreenShot_Rentals.PNG

     'Create new tab - copy "Blank_Form" template
    Sub NewTab()
      Application.ScreenUpdating = False
      Application.DisplayAlerts = False
        Dim sName As String
        Dim wks As Worksheet
        Sheets("Blank_Form").Visible = True
        Worksheets("Blank_Form").Copy After:=Sheets(Worksheets.Count)
        Set wks = ActiveSheet
        Do While sName <> wks.Name
            sName = Application.InputBox _
              (Prompt:="Enter Asset Number.  Numbers Only, No Letters")
            On Error Resume Next
            wks.Name = sName
            Range("E2") = sName
            On Error GoTo 0
         Loop
        Set wks = Nothing
      On Error Resume Next
      Sheets("False").Delete
      Sheets("Blank_Form").Visible = xlSheetVeryHidden
      Application.DisplayAlerts = True
      Application.ScreenUpdating = True
      End Sub
    Last edited by Kenny Blackwell; 08-27-2015 at 12:05 PM.

+ 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. Requiring input by user to be either "Economy", "Business" or "Club"
    By cmurda in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2014, 08:57 PM
  2. Replies: 2
    Last Post: 04-20-2014, 11:18 AM
  3. Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)" not working
    By redders in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2011, 03:52 PM
  4. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  5. How do I stop a Macro after "Cancel" is chosen in an input box?
    By c991257 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-10-2007, 02:27 PM
  6. Replies: 7
    Last Post: 05-13-2006, 05:02 PM
  7. [SOLVED] IF(VLOOKUP("MYDATA", MYNAME, 4) = 0, "TRUE", "FALSE")
    By Souris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2005, 01:05 AM

Tags for this Thread

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