Response to Userform Problems?

I

Incidental

Hi Sue

The code below will take the value of each of the 24 textboxes and
pass it to the next empty row on the sheet 8 controls at a time. I
hope this is of some help to you

Option Explicit
Dim Ctrl As Control
Dim i As Integer
Dim NewRec As Range
Private Sub CommandButton1_Click()

Set NewRec = [D65535].End(xlUp).Offset(1, 0)

For i = 1 To 24

Set Ctrl = UserForm1.Controls("TextBox" & i)

If i = 9 Or i = 17 Then

Set NewRec = NewRec.Offset(1, -8)

End If

NewRec.Value = Ctrl.Value

Set NewRec = NewRec.Offset(0, 1)

Next i

End Sub

Steve
 
J

Jon Peltier

Could you keep your responses in the same thread as the question? Separate
responses do not benefit anyone who has read the initial thread.

- Jon
 
I

Incidental

Hi Jon

i agree fully the only reason i posted a new reply is because the
original post was giving me an error when i tried to access it. i
prob should have noted that in my post to prevent confusion...

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top