Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default referencing multiple controls using a variable


There may be a better way, but this works.

(Color 'family' generator - the RGB part - thrown in for free :Bgr )

Public Sub dev3()

Dim sName As String
Dim iI As Integer

For iI = 1 To 3
sName = "ListBox" & CStr(iI)
ActiveSheet.OLEObjects(sName).Object.BackColor = RGB(80 * iI,
80 * 11, 80 * (3 - iI))
Next iI

End Sub


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=118933

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
Referencing Controls Using Variables Teodomiro[_3_] Excel Programming 4 April 28th 06 06:21 PM
referencing forms controls AlbertYWang Excel Programming 3 February 1st 06 01:59 PM
Referencing worksheet controls Frederick Chow Excel Programming 2 December 12th 05 05:42 PM
Excel 2003 Referencing multiple workbooks via single variable BBohannon Excel Worksheet Functions 0 April 20th 05 08:32 PM
Referencing to controls on a worksheet John Nikolopoulos Excel Programming 3 September 10th 03 10:08 AM


All times are GMT +1. The time now is 01:29 PM.

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"