+ Reply to Thread
Results 1 to 5 of 5

selecting cancel gives me FALSE

Hybrid View

tvonbehren selecting cancel gives me... 08-14-2009, 09:30 AM
romperstomper Re: selecting cancel gives me... 08-14-2009, 09:45 AM
sweep Re: selecting cancel gives me... 08-14-2009, 09:47 AM
mudraker Re: selecting cancel gives me... 08-14-2009, 10:02 AM
tvonbehren Re: selecting cancel gives me... 08-14-2009, 11:48 AM
  1. #1
    Registered User
    Join Date
    07-16-2009
    Location
    Cartersville, Georgia
    MS-Off Ver
    Excel 2007
    Posts
    43

    selecting cancel gives me FALSE

    i have a code that i am using but however when I click on the cancel it is giving me a false in the cell when all I am want is to cancel and leave the information in the cell. Here is an example of the code i am using. I am new to using VBA so please bare with me and any help would be greatly appreciated. Thank you
    If Target.Address = "$E$115" Then
       myDate = Application.InputBox("Enter A Date", "Date Entry")
        Sheets(3).Range(Target.Address) = myDate
        Sheets(3).Range("$E$114") = myDate
        Sheets(2).Range("$D$12") = myDate
     End If
    Last edited by tvonbehren; 08-14-2009 at 12:33 PM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,974

    Re: selecting cancel gives me FALSE

    Try:
    If Target.Address = "$E$115" Then
    myDate = Application.InputBox("Enter A Date", "Date Entry")
    If myDate <> False Then
    Sheets(3).Range(Target.Address) = myDate
    Sheets(3).Range("$E$114") = myDate
    Sheets(2).Range("$D$12") = myDate
    End If
    End If
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: selecting cancel gives me FALSE

    Or...

    If Target.Address = "$E$115" Then
    myDate = Application.InputBox("Enter A Date", "Date Entry")
    If myDate = False Then GoTo WayOut
    Sheets(3).Range(Target.Address) = myDate
    Sheets(3).Range("$E$114") = myDate
    Sheets(2).Range("$D$12") = myDate
    
    WayOut:
    End If
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: selecting cancel gives me FALSE

    tvonbehren

    Please take a couple of minutes and read ALL theForum Rules then wrap your VBA code (Rule 3)
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Registered User
    Join Date
    07-16-2009
    Location
    Cartersville, Georgia
    MS-Off Ver
    Excel 2007
    Posts
    43

    Smile Re: selecting cancel gives me FALSE

    Thank you for the help both of these work great.

+ 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