cellMatrix.net

Spreadsheet Modeling and Related Topics

RefEdit Entries

Recently I've been working on creating a ribbon tab for Excel 2007 that interfaces with and controls several of the add-ins that I use for work. The Goal Seek Tool is one of those add-ins. I created this tool to allow the entry of a single-cell range or value when performing the goal-seek function.

In November 2008 I wrote a short post about my Goal Seek tool. In my first version of that tool, I used a RefEdit control to enter a range and a textbox to enter a value. In a comment to that post, Jon Peltier noted that the textbox could be eliminated and the RefEdit control could be programmed to accept either a range or text entry.

After a lot of time searching the internet, I finally found an example of how this functionality could work on the TM Consulting site. It looks like this:

When wanting to enter a range with RefEdit and assuming the RefEdit control is named "RefEdit1", use

Range(RefEdit1) 

When wanting to enter a value with RefEdit, use

Range(RefEdit1).value 

When wanting to validate the entries made into RefEdit, you can use examples like:

To validate that a range contains a formula, use

HasFormula(Range(RefEdit1)) 

To validate that a range contains a number, use

IsNumeric(RefEdit1)

Posted on Tuesday, February 16, 2010 | Comments (0) | Permalink

Comment Entry Form

User Information

Name: (Required)

E-Mail Address: (Optional)

Location: (Optional)

Web Site Address: (Optional)

Comment Formatting Reference
Add VBA Code:
<pre>some code here</pre>
Linking:
[url]http://www.example.com/[/url]
[url=http://www.example.com/]my site[/url]
Text Formatting
[size=4]Some larger text[/size]
[color=green]Some green text[/color]
[b]Some bold text[/b]
[i]Some italic text[/i]
Enter Comment Below

Personalization Options
Remember my personal information
Notify me of follow-up comments?

Next entry: Excel 2010 Chart Improvements - Migrating Excel 4 Macros to VBA

Previous entry: VBA Fireworks Model from AJP Excel Information

<< Back to main

Statistics

  • Total Entries - 136
  • Current Viewers - 28

Categories

Entries by Day

Jul - 2010
S M T W T F S
27 28 29 30 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Recent Comments

Syndicate