I'm trying to input data into a table using textboxes but i'm having issues with the code that im using.
I want to be able to input a value into a cell (C2) and then the next value to be entered to go on the cell below (C3)
What i'm getting at the moment is that everytime I input a carachter into the Textbox the macro select the next cell, it looks something like this:
C
1 1
2 12
3 123
4 1234
5 12345
Instead of
C
1 12345
The code works for Input boxes but not for Textboxes and i will like to be able to used text boxes.
Someone know how to fix this problem or if there is an easier way to do it?
This is the code im using:
Sheets("Magnetite delivery").Select
Dim found As Boolean: found = False
Dim i As Long: i = 2
Dim MagDocket As String
MagDocket = MagnetiteDocket.Value
If MagDocket <> "" Then
While Not found
If Range("C" & i).Value = "" Then
Range("C" & i).Value = MagDocket
found = True
Else
i = i + 1
End If
Wend
End If
I want to be able to input a value into a cell (C2) and then the next value to be entered to go on the cell below (C3)
What i'm getting at the moment is that everytime I input a carachter into the Textbox the macro select the next cell, it looks something like this:
C
1 1
2 12
3 123
4 1234
5 12345
Instead of
C
1 12345
The code works for Input boxes but not for Textboxes and i will like to be able to used text boxes.
Someone know how to fix this problem or if there is an easier way to do it?
This is the code im using:
Sheets("Magnetite delivery").Select
Dim found As Boolean: found = False
Dim i As Long: i = 2
Dim MagDocket As String
MagDocket = MagnetiteDocket.Value
If MagDocket <> "" Then
While Not found
If Range("C" & i).Value = "" Then
Range("C" & i).Value = MagDocket
found = True
Else
i = i + 1
End If
Wend
End If