Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default How do I have Excel VB write a open ended formula?

Hello!

The idea to the code below would make it possiable so that a person
could hit a button and a macro would convert the current number in the
active cell to add a formula to give the sum of the next possiable
number entered by the enduser... Think of it like the following...

END USER TYPES "9"
PRESS A BUTTON (Not keyboard) WITH A "+"
END USER TYPES "9" again...

Macro kicks in a makes it "=9+9" to have the spreadsheet display the
finished result.


This is to make it so that someone who doesn't know how to do formulas
inside of Excel could get the result they are looking for...

ActiveCell.Value = 9 (or which ever number the enduser chooses to
enter)

TAXES.ActiveCell.Formula = "=" & ActiveCell.Text & "+" & "1"
' This is the initial idea of getting it to work...The & "1" is placed
as a temporary number to complete the formula.

If Len(TAXES.ActiveCell.Text) 0 Then
TAXES.ActiveCell.Value = Left(TAXES.ActiveCell.Text,
Len(TAXES.ActiveCell.Text) - 1)
' This code above deletes the 1 leaving the activecell formula to be
=9+(EMPTY)

Any help is much appreciated...I been trying to figure this out the
last few hours and haven't had much luck...Thanks!!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How do I have Excel VB write a open ended formula?

Assuming the <formula is correctly entered into a text box, then a button
click can send it to cell :

Activecell.formula="=" & TextBox2.Text

NickHK

wrote in message
ps.com...
Hello!

The idea to the code below would make it possiable so that a person
could hit a button and a macro would convert the current number in the
active cell to add a formula to give the sum of the next possiable
number entered by the enduser... Think of it like the following...

END USER TYPES "9"
PRESS A BUTTON (Not keyboard) WITH A "+"
END USER TYPES "9" again...

Macro kicks in a makes it "=9+9" to have the spreadsheet display the
finished result.


This is to make it so that someone who doesn't know how to do formulas
inside of Excel could get the result they are looking for...

ActiveCell.Value = 9 (or which ever number the enduser chooses to
enter)

TAXES.ActiveCell.Formula = "=" & ActiveCell.Text & "+" & "1"
' This is the initial idea of getting it to work...The & "1" is placed
as a temporary number to complete the formula.

If Len(TAXES.ActiveCell.Text) 0 Then
TAXES.ActiveCell.Value = Left(TAXES.ActiveCell.Text,
Len(TAXES.ActiveCell.Text) - 1)
' This code above deletes the 1 leaving the activecell formula to be
=9+(EMPTY)

Any help is much appreciated...I been trying to figure this out the
last few hours and haven't had much luck...Thanks!!!



Reply
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
Need open ended cell for Sum range. Cris B. Excel Worksheet Functions 9 October 14th 05 04:52 PM
open ended multi page sum AlZee Excel Worksheet Functions 2 November 1st 04 10:53 PM
open ended multi page sum AlZee Excel Worksheet Functions 1 November 1st 04 01:26 AM
open ended multi page sum AlZee Excel Worksheet Functions 2 October 31st 04 05:49 PM
open ended multi page sum AlZee Excel Worksheet Functions 3 October 30th 04 11:30 PM


All times are GMT +1. The time now is 03:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"