Share via

Excel User form to Display Data

Anonymous
2011-03-29T18:46:02+00:00

I would like to display data from a worksheet within a user form. The range is fixed ("K25:Q25") on the active sheet.

The below code only displays the first cell.

Private Sub UserForm_Initialize()

Set rs = Worksheets("Sheet1")

rs.Range("K25:Q25").Activate

Label1.Caption = ActiveCell.Value

End Sub

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-03-29T19:37:52+00:00

Hi,

Maybe this

Private Sub UserForm_Initialize()

Dim MyString as string

Set rs = Worksheets("Sheet1")

For Each c In rs.Range("K25:Q25")

    MyString = MyString & c.Value

Next

Label1.Caption = MyString

End Sub

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2011-03-29T19:41:02+00:00

    How do you want to display the data?

    In a list, list a drop-down list?

    As seven separate text boxes?

    Was this answer helpful?

    0 comments No comments