Hello,
I have quite some text-boxes for entering data. For user to be efficient i created _Exit event with setting focus on next textbox.
So user can just move to next textbox only with return key, no need to use mouse.
Now comes the problem. If user makes mistake and wants to correct value in previous textbox, textbox cannot be selected because there is _Exit event on next text box which moves focus to next textbox so long that it comes to commandbutton, where it clears all textboxes and set focus on first textbox for new entries.
In the userform there is also listview to immediately reflect entered values.
Does anyone have an idea how to make possibility to be able to correct values in previous textboxes, before coming to commandbutton.
Private Sub TextBoxAnalizeNed_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Cells(j, 16).Value = TextBoxAnalizeNed
Me.ListView1.ListItems.Clear
Me.ListView1.ColumnHeaders.Clear
With Me.ListView1
.Gridlines = True
.HideColumnHeaders = False
.View = lvwReport
End With
'Set the source worksheet
Set wksSource = Worksheets("VhodniPodatkiKoncna")
'Set the source range
Set rngData = wksSource.Range("B1:P" & LastRowNaziv)
'Add the column headers
For Each rngCell In rngData.Rows(1).Cells
Me.ListView1.ColumnHeaders.Add Text:=rngCell.Value, Width:=55
Next rngCell
For k = 2 To LastRowNaziv
Set LstItem = Me.ListView1.ListItems.Add(Text:=rngData(k, 1).Value)
For l = 2 To LastCol
LstItem.ListSubItems.Add Text:=rngData(k, l).Value
ListView1.ColumnHeaders(1).Width = 150
Next l
Next k
TextBoxAnalizeNed.SetFocus
End Sub
Thanks for any suggestion
Bookmarks