Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing, Declaring, and Assigning Objects
I solved my own problem. I don't know how efficient it is but this is doing what I need wit fewer lines of code. Thanks to anyone who looked and tried to find a solution. Tim ------------------------------------------------------------------------------------------------------ Private Sub UserForm_Initialize() 'load sheet data Call PopulateObjArrays Dim i As Integer Dim strName As String Dim db As String Dim cell As String Dim ctl As Control 'load ID's For i = 0 To DIM_ROW_COUNT - 1 Step 1 strName = "lbl" + DimArray(i, 0) + "ID" Set ctl = AllInputs.Controls.Item(strName) db = DimArray(i, 1) cell = "A" + DimArray(i, 2) Call modFormUpdate.sendCellToLabel(ctl, db, cell) Next i End Sub -------------------------------------------------------------------------------------------------- 'Takes the contents of a Cell and places in in the designated Label Function sendCellToLabel(ByRef Lbl As Control, ByRef SheetName As String, ByRef CellName As String) Lbl.Caption = Worksheets(SheetName).Range(CellName) End Functio -- tfran ----------------------------------------------------------------------- tfrank's Profile: http://www.excelforum.com/member.php...fo&userid=1588 View this thread: http://www.excelforum.com/showthread.php?threadid=27372 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Beginer to UserForms question on assigning properties to objects | Excel Discussion (Misc queries) | |||
Assigning VB to Grouped Objects | Excel Discussion (Misc queries) | |||
Passing Excel Objects As Parameters | Excel Programming | |||
Passing Excel Objects As Parameters | Excel Programming | |||
Calling Procedures from another excel sheet by passing objects | Excel Programming |