ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using variables within a formula in the same cell. (https://www.excelbanter.com/excel-discussion-misc-queries/155998-using-variables-within-formula-same-cell.html)

bbhart

Using variables within a formula in the same cell.
 
How do I make a formula with a variable (ex. 4+x), and make is so when I type
in a number into that cell it puts that number in as the variable? Is this
even possible? Thanks for your help in advance cause this problem has taken
way too much of my time already!

Jim Thomlinson

Using variables within a formula in the same cell.
 
Not just 100% sure what you want to do. Are you wanting to put a formula in
Cell A1 such as =4+x and then in cell A1 type a 3 and heve the cell value
automatically be 7... or are you wanting something else entirely.
--
HTH...

Jim Thomlinson


"bbhart" wrote:

How do I make a formula with a variable (ex. 4+x), and make is so when I type
in a number into that cell it puts that number in as the variable? Is this
even possible? Thanks for your help in advance cause this problem has taken
way too much of my time already!


Don Guillett

Using variables within a formula in the same cell.
 
If?? you mean that you want to type in 1 and get 4, type in 2 and get 8 you
can do this with a worksheet_change event macro.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"bbhart" wrote in message
...
How do I make a formula with a variable (ex. 4+x), and make is so when I
type
in a number into that cell it puts that number in as the variable? Is this
even possible? Thanks for your help in advance cause this problem has
taken
way too much of my time already!



bbhart

Using variables within a formula in the same cell.
 
Yeah... sorry... I should have been more specific. That's exactly what I'm
trying to do.

"Jim Thomlinson" wrote:

Not just 100% sure what you want to do. Are you wanting to put a formula in
Cell A1 such as =4+x and then in cell A1 type a 3 and heve the cell value
automatically be 7... or are you wanting something else entirely.
--
HTH...

Jim Thomlinson


"bbhart" wrote:

How do I make a formula with a variable (ex. 4+x), and make is so when I type
in a number into that cell it puts that number in as the variable? Is this
even possible? Thanks for your help in advance cause this problem has taken
way too much of my time already!


Jim Thomlinson

Using variables within a formula in the same cell.
 
2 ways to do it... One is to use VBA and capture the cell change and apply
your formula through that or you can do it with a bit of hocus pocus using
the Camera tool. Here is a link to the Camera Tool thing.

http://j-walk.com/ss/excel/odd/odd04.htm

Place a formula on sheet 2 something to the effect of =Sheet1!A1 + 4
On sheet 1 format Cell A1 such that the font colour is the same as the
background colour (probably white). If you follow those steps from the web
site I posted you can make it work...
--
HTH...

Jim Thomlinson


"bbhart" wrote:

Yeah... sorry... I should have been more specific. That's exactly what I'm
trying to do.

"Jim Thomlinson" wrote:

Not just 100% sure what you want to do. Are you wanting to put a formula in
Cell A1 such as =4+x and then in cell A1 type a 3 and heve the cell value
automatically be 7... or are you wanting something else entirely.
--
HTH...

Jim Thomlinson


"bbhart" wrote:

How do I make a formula with a variable (ex. 4+x), and make is so when I type
in a number into that cell it puts that number in as the variable? Is this
even possible? Thanks for your help in advance cause this problem has taken
way too much of my time already!


Don Guillett

Using variables within a formula in the same cell.
 
right click sheet tabview codeinsert this. Now if you put 1 in cell b1 you
get 5 in cell b1

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$B$1" Then Exit Sub
Application.EnableEvents = False
Target = Target + 4
Application.EnableEvents = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"bbhart" wrote in message
...
Yeah... sorry... I should have been more specific. That's exactly what I'm
trying to do.

"Jim Thomlinson" wrote:

Not just 100% sure what you want to do. Are you wanting to put a formula
in
Cell A1 such as =4+x and then in cell A1 type a 3 and heve the cell value
automatically be 7... or are you wanting something else entirely.
--
HTH...

Jim Thomlinson


"bbhart" wrote:

How do I make a formula with a variable (ex. 4+x), and make is so when
I type
in a number into that cell it puts that number in as the variable? Is
this
even possible? Thanks for your help in advance cause this problem has
taken
way too much of my time already!




All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com