+ Reply to Thread
Results 1 to 2 of 2

Adding items to another sheet

Hybrid View

  1. #1
    Registered User
    Join Date
    06-09-2007
    Posts
    29

    Adding items to another sheet

    This is my code for adding regions

    Private Sub btnAddRegion_Click()
    Dim newregion As String
    
    newregion = Application.InputBox("Enter the name of the new region", "New Region")
    
    Sheets("Region").Range("A65536").End(xlUp).Offset(1, 0).Value = newregion
    
    
    End Sub
    This works fine apart from when i click cancel (not to add a region), it adds a false. Can this be stopped?

    Thanks

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Try

    newregion = Application.InputBox("Enter the name of the new region", "New Region")
    
    If newregion <> "False" Then
      Sheets("Region").Range("A65536").End(xlUp).Offset(1, 0).Value = newregion
    End If


    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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