populating data show error in textboxes number on userform

Hasson

Active Member
Joined
Apr 8, 2021
Messages
391
Office Version
  1. 2016
Platform
  1. Windows
Hi
I have about 24 textboxes when I select the item from listbox should populate from textbox 1 to textbox24 , but it populates staring from textbox 3,
the textbox1,2 is empty !!! what's the mistake?
VBA Code:
Private Sub ListBox1_Click()
For i = 0 To ListBox1.ListCount
    If ListBox1.Selected(i) = True Then
        For j = 1 To 24
        Controls("TextBox" & j).Text = Cells(ListBox1.List(i, 1), j)
        Next j
    End If
Next i
End Sub
 
welcome glad resolved & appreciate feedback

Dave
 
Upvote 0

Excel Facts

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

Forum statistics

Threads
1,215,781
Messages
6,126,870
Members
449,345
Latest member
CharlieDP

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