Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Deriving a name from variables

I have 22 CheckBox objects named CheckBox1, CheckBox2 etc. I would like to
substitue a variable to represent the name in the expression
"Sheet2.TextBox1= False" by using a do loop and varying the number portion
of the word TextBox. Any suggestions?
--
Bernie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Deriving a name from variables

Checkboxes and textboxes from the control toolbox toolbar???

I'm not quite sure what you're doing, but maybe this will give you an idea:

Option Explicit
Sub testme()
Dim iCtr As Long
With Sheet2
For iCtr = 1 To 22
.OLEObjects("textbox" & iCtr).Object.Enabled _
= .OLEObjects("checkbox" & iCtr).Object.Value
Next iCtr
End With
End Sub




brichard429 wrote:

I have 22 CheckBox objects named CheckBox1, CheckBox2 etc. I would like to
substitue a variable to represent the name in the expression
"Sheet2.TextBox1= False" by using a do loop and varying the number portion
of the word TextBox. Any suggestions?
--
Bernie


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Deriving a name from variables

Thank You Dave. Here is the code I used to clear all of the 22 CheckBoxes of
checks using your suggestion.

Dim iCtr As Long
With Sheet2
For iCtr = 1 to 22
.OLEObjects("CheckBox" & iCtr).Object.Value = False
Next iCtr
End With
--
Bernie


"Dave Peterson" wrote:

Checkboxes and textboxes from the control toolbox toolbar???

I'm not quite sure what you're doing, but maybe this will give you an idea:

Option Explicit
Sub testme()
Dim iCtr As Long
With Sheet2
For iCtr = 1 To 22
.OLEObjects("textbox" & iCtr).Object.Enabled _
= .OLEObjects("checkbox" & iCtr).Object.Value
Next iCtr
End With
End Sub




brichard429 wrote:

I have 22 CheckBox objects named CheckBox1, CheckBox2 etc. I would like to
substitue a variable to represent the name in the expression
"Sheet2.TextBox1= False" by using a do loop and varying the number portion
of the word TextBox. Any suggestions?
--
Bernie


--

Dave Peterson
.

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
Deriving P-Value through LINEST Function RJ Excel Worksheet Functions 2 May 2nd 23 03:46 AM
Deriving winners from a list Harold Excel Discussion (Misc queries) 4 November 9th 09 10:00 PM
Deriving from 0.5" to 0.5 and so on ..... Values only. Aligahk06 Excel Discussion (Misc queries) 2 October 11th 09 02:47 PM
Deriving Exactly XXX Amount of Weekdays Rob Excel Worksheet Functions 3 July 2nd 09 05:54 PM
Deriving mathematical equations damo Excel Worksheet Functions 1 April 23rd 06 05:55 PM


All times are GMT +1. The time now is 06:57 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"