LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do I call a dynamically created String in a VBA Sub

Hi,

I have 50 Check Boxes and I'm trying to create a Sub that accepts an
Integer parameter (1-50) and then changes the value of the check box to
true.

This is the code that I'm trying to do

Sub chngVal(x)
Dim thestring As String
thestring = "CheckBox" & x & ".Value = True"
thestring
End Sub

So if I called chngVal(25), it would call CheckBox25.Value = True.

This code doesn't work but is there a way to create a String or some
form of Object and then call the line?

Thanks!

Ilan

 
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
dynamically created listbox clem Excel Programming 3 September 26th 06 03:30 PM
Scaling a chart that has been dynamically created in vb Mark Charts and Charting in Excel 3 May 27th 05 08:16 PM
Back color of dynamically-created buttons simon Excel Programming 2 April 11th 05 11:44 AM
Assign macros to dynamically created form elements Joepy Excel Programming 4 March 3rd 04 09:03 PM


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