Texbox Loop to fill several Cells

adilem

New Member
Joined
Jun 16, 2011
Messages
1
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
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,224,527
Messages
6,179,348
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top