Hi! First of all I have almost no experience in VBA, meaning that my programming in this case may be pretty bad. I need a program that stores data into continuous cells in a worksheet. This data is entered through a textbox, which has it's own subroutine that executes after updated. My Idea is that the loop executes, but waits until the subroutine finishes before continuing, meaning that the user should be able to change the data for each cell. Since the number of data is established through a dynamic array, I must use the same textbox to change all the data values. My question is how can I make a loop wait until a subroutine linked to a textbox update finishes?? Im not sure if you understand me, since I don't really speak english. These is my code:
Private Sub TxtBxCmnMatArray_AfterUpdate()
Sheets("Listas").Range("E3").Value = TxtBxCmnMatArray.Value
End Sub
Private Sub TxtBxCmnMatRange_Enter()
Dim a As Integer
Sheets("Listas").Range("E4").Activate
For a = 1 To Sheets("Listas").Range("E3").Value
Call TxtBxCmnMatRange_AfterUpdate
ActiveCell.Offset(1, 0).Activate
Next a
End Sub
Public Sub TxtBxCmnMatRange_AfterUpdate()
ActiveCell.Offset(1, 0).Activate
ActiveCell.Value = TxtBxCmnMatRange.Value
End Sub
Sadly, the loop doesn't wait for the sub to be executed, counting the number of cells specified through "TxtBxCmnMatArray.Value" without allowing the user to enter the desired values on each cell.
Any help is appreciated.
Thanks
Bookmarks