Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Beginer to UserForms question on assigning properties to objects [email protected] Excel Discussion (Misc queries) 3 July 27th 07 01:45 PM
Assigning VB to Grouped Objects Spinner Excel Discussion (Misc queries) 0 December 29th 05 08:32 PM
Passing Excel Objects As Parameters Jake Marx[_3_] Excel Programming 0 September 17th 04 04:25 PM
Passing Excel Objects As Parameters MDW Excel Programming 0 September 17th 04 04:17 PM
Calling Procedures from another excel sheet by passing objects Thomas Auburn Excel Programming 0 May 5th 04 05:33 PM


All times are GMT +1. The time now is 03:52 AM.

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

About Us

"It's about Microsoft Excel"