Solved

Range Name With Text Box Input

Posted on 2014-04-07
2
295 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
[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 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

729 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