Worksheet value entered into userform textbox

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,224
Office Version
  1. 2007
Platform
  1. Windows
Hi,
As per title i wish to get worksheet cell value to userform textbox.

The code below is in use.
I get no RTE but textboxes remain blanl.

Some info for you.
Worksheet is called HONDA SHEET
Values are in cells Z21:Z57
Userform Textboxes are Textbox 1 through to Textbox39

Rich (BB code):
    Dim x As Integer
    Dim ws As Worksheet
    
    Set ws = ThisWorkbook.Sheets("HONDA SHEET")
    
    x = 1
    For x = 1 To 39
        Controls("TextBox" & x).Value = ws.Range("Z21" & x).Value
    Next x
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Excel Formula:
For x = 1 To 39
        Controls("TextBox" & x).Value = ws.Range("Z" & 20+ x).Value
    Next x
 
Upvote 0
Solution
You are very welcome
And thank you for the feedback
Be happy and safe
 
Upvote 0
Hi,
May i ask another question please regarding the same thing


Rich (BB code):
For x = 1 To 39
        Controls("TextBox" & x).Value = ws.Range("Z" & 20+ x).Value
    Next x

The above would enter the values to Textboxes 1 - 39 from column Z

How would i also do the same BUT also enter values to Textboxes 40-78 from column Y

Thanks
 
Upvote 0
Try
VBA Code:
  For x = 1 To 39
        Controls("TextBox" & x).Value = ws.Range("Z" & 20 + x).Value
        Controls("TextBox" & x + 39).Value = ws.Range("Y" & 20 + x).Value
    Next x
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,003
Members
448,935
Latest member
ijat

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