Make the target active and ready for entering data

YasserKhalil
PlatinumLounger
Posts: 4961
Joined: 31 Aug 2016, 09:02

Make the target active and ready for entering data

Post by YasserKhalil »

Hello everyone
I have a code in worksheet selectionchange

Code: Select all

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Cells.CountLarge > 1 Then Exit Sub
    If Target.Column > 5 And Target.Column <= 19 Then
        If Target.Value = "-" Then
        Target.Select
        Application.SendKeys "{F2}"
        LettersForm.Show 0
        
        
        End If
    End If
End Sub
I need to make the target cell to be ready for entering data directly even with the userform LettersForm is shown. I tried to make it modeless by adding and also tried Target.Select and even tried Application.SendKeys "{F2}" but nothing worked. I have to select the cell again manually.

User avatar
HansV
Administrator
Posts: 79287
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Make the target active and ready for entering data

Post by HansV »

I think that it's impossible to do what you want.
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4961
Joined: 31 Aug 2016, 09:02

Re: Make the target active and ready for entering data

Post by YasserKhalil »

Thanks a lot my tutor.