Solved

Excel 2003 VB Variable used in Controls of user froms.

Posted on 2011-09-22
2
159 Views
Last Modified: 2012-05-12
Hello,

I am creating a user form in Excel that has a number of text boxes that a user enters data into. Some are to be numeric only.  If a user enters non-numeric data in the box there is code to catch that and return a zero value and lets the user know.  Rather than right the code for each box I assign a integer variable to the code on each TextBox and pass that along to a public function that uses that to create a variable representing the TextBox control name.  ie  It takes "TextBox" and combines it with 1, 2, 3, etc and uses that as the control name to run the routine.  It fails please help.  Sample is attached. Text-Box-Variable.xls
0
Comment
Question by:DavidH7470
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 24

Accepted Solution

by:
StephenJR earned 500 total points
ID: 36583049
Not sure what you are doing, but perhaps amend module1 to
 If Not IsNumeric(UserForm1.Controls(StrOptName).Value) Then

Open in new window

0
 

Author Closing Comment

by:DavidH7470
ID: 36583099
Great Thank you.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question