Solved

Range Name With Text Box Input

Posted on 2014-04-07
2
276 Views
Last Modified: 2014-04-07
How do you construct an Excel 2010 macro to name range (A3) using data from a text box,  SBINumberTextBox.Text, and concatenate it with some standard text, i.e. ProjectName?
0
Comment
Question by:cowboywm
2 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 39983810
Often, if you record a macro doing what you're trying to do, you will get most of the elements for the answer.

The following code will add a workbook-level name called ProjectName" & SBINumberTextBox.Text, referring to A3 of sheet 1.

ActiveWorkbook.Names.Add Name:= "ProjectName" & SBINumberTextBox.Text, RefersToR1C1:="=Sheet1!R3C1"

Thomas
0
 

Author Closing Comment

by:cowboywm
ID: 39984737
Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now