Results 1 to 8 of 8

Thread: Deselect value in inputbox
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Oct 2017
    Location
    Derby. England
    Posts
    212
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Deselect value in inputbox

    Hi,

    Is there a way of deselecting the value that is in my input box when it opens?

    If so I'd like the prompt to be after the value.

    Any help would be appreciated.

    Thanks

    Dan

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,229
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Deselect value in inputbox

    Can you post the code that you are using to show the input box?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    Board Regular
    Join Date
    Oct 2017
    Location
    Derby. England
    Posts
    212
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Deselect value in inputbox

    Hi Fluff,

    Here is my code:

    Code:
    Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
    
    Dim C As Range
    Dim Response As String
    If Target.Row <= 6 Then Exit Sub
    If Target.Column = 1 Then
    Application.EnableEvents = False
    Response = UCase(InputBox("Please enter the line and batch.", "QA", "9" & Format(Date - DateSerial(Year(Date), 1, 0), "000") & "1092 - "))
    ActiveCell.Offset(0, 1).Select
    End If
    Application.EnableEvents = True
    End Sub
    Thanks

    Dan

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,229
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Deselect value in inputbox

    With that code, to deselect the value, simply start typing
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  5. #5
    Board Regular
    Join Date
    Oct 2017
    Location
    Derby. England
    Posts
    212
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Deselect value in inputbox

    Hi Fluff,


    If I start typing without using the right arrow key, what I type, types over the "92881092 - " that is in the InputBox when loaded.

    I missed this line of code from my previous message:
    Code:
    ActiveCell.Value = Response
    Thanks

    Dan

  6. #6
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,229
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Deselect value in inputbox

    Ok, I understand what you are saying & I know of no way to do what you are after.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  7. #7
    Board Regular
    Join Date
    Oct 2017
    Location
    Derby. England
    Posts
    212
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Deselect value in inputbox

    Ok. Thank you for having a look.

  8. #8
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,229
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Deselect value in inputbox

    My pleasure.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

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
  •