Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Assign range to userform labels and textboxes

Hi all,

I'm putting together a Userform which is to be used to amend existing data in an excel worksheet. I've already put together a userform to load the data-no problems...however i'm struggling with my limited knowledge to work out this next phase.

The following code selects all the columns in the first row and populates the combo box with a list of part numbers from column A (so row to amend can be selected) which is fine. The rest of the code selects all the headings in Row 1 (for transfer into the caption property of my Userform Labels) when i only want the first 13 (range A1:13)-I can't work out the syntax needed to do this.

Private Sub UserForm_Activate()
With Data.Cells(1).CurrentRegion
Cbo_Partno.List = .Offset(1).Value
sq = .Rows(1)
End With

For j = 1 To UBound(sq, 2)
Me("Label" & j).Caption = sq(1, j)
Next

End Sub

Hopefully you guys can help with this and i'll learn something new (again!!)

Thanks
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textboxes and labels in Userform?? TotallyConfused Excel Programming 5 September 25th 09 05:01 AM
Text wrap problem when printing labels/textboxes chipshot Excel Discussion (Misc queries) 1 September 30th 05 10:21 PM
Assign click functionality to dynamically created textboxes? Ouka[_17_] Excel Programming 3 August 25th 05 03:15 AM
userform & textboxes beginner Excel Programming 3 July 27th 04 10:56 AM
Clear Textboxes, Labels, and Checkboxes milo[_2_] Excel Programming 1 October 16th 03 09:21 PM


All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"