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: 116
Default Easy One - Syntax for variables in TextBox & Label names

Hello:

What is the correct syntax for including a variable (in this case "i") in
the name of a TextBox and/or Label?

I have a list of TextBoxes and Labels on a userform and I want to program a
reset button to change what is displayed back to the defaults. I need
something like this:

Private Sub CommandButton8_Click()
For i = 1 To 13
TextBox(i).Text = "0"
Label(i).Caption = "N/A"
Next i
End Sub

I'm getting a Sub or Function not defined error, and I know it's because the
syntax is wrong. Help is appreciated.

Thanks,
MARTY

 
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
Easy Syntax question: referring to worksheet by VBA name KR Excel Programming 2 November 22nd 04 07:53 PM
Is there an easy way calculate 2 variables in conditional sum wiz. Liketoknow Excel Worksheet Functions 1 November 10th 04 09:34 AM
Easy VBA Syntax Question Hulk[_6_] Excel Programming 4 October 13th 04 07:23 PM
Easy VBA Syntax Question Hulk[_7_] Excel Programming 0 October 13th 04 06:41 PM
easy question : textbox Yan Robidoux Excel Programming 6 August 9th 04 01:05 PM


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