Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Hector
 
Posts: n/a
Default Calculate to another cell as default value

Hi.

Given the following:

A B C
1 5 9 __
2 8 10 __

I'd like for the user to enter values in A and B and have Excel display B
minus A in C as a DEFAULT value. That is, for row 1, once the user enters 9
in B, I want to display 4 in C but give the user the option to override the
calculation. A formula in C won't work because the user would delete the
formula if he overrides it.

Thanx.

I don't
  #2   Report Post  
Niek Otten
 
Posts: n/a
Default

Why not use an extra column (C) and have this formula in D:

=IF(C1="",B1-A1,C1)

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Hector" wrote in message
...
Hi.

Given the following:

A B C
1 5 9 __
2 8 10 __

I'd like for the user to enter values in A and B and have Excel display B
minus A in C as a DEFAULT value. That is, for row 1, once the user enters
9
in B, I want to display 4 in C but give the user the option to override
the
calculation. A formula in C won't work because the user would delete the
formula if he overrides it.

Thanx.

I don't



  #3   Report Post  
Hector
 
Posts: n/a
Default

That's a good idea. Though, I would like for the user to enter a value only
in exceptions. This method would make the user do the calculation which will
be more complicated.

Thanx.

"Niek Otten" wrote:

Why not use an extra column (C) and have this formula in D:

=IF(C1="",B1-A1,C1)

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Hector" wrote in message
...
Hi.

Given the following:

A B C
1 5 9 __
2 8 10 __

I'd like for the user to enter values in A and B and have Excel display B
minus A in C as a DEFAULT value. That is, for row 1, once the user enters
9
in B, I want to display 4 in C but give the user the option to override
the
calculation. A formula in C won't work because the user would delete the
formula if he overrides it.

Thanx.

I don't




  #4   Report Post  
Niek Otten
 
Posts: n/a
Default

I don't see what you mean. If the users enters nothing in C, Excel will
subtract B from A. Only if he enters something in C, then that will be used.
Do I miss something?

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Hector" wrote in message
...
That's a good idea. Though, I would like for the user to enter a value
only
in exceptions. This method would make the user do the calculation which
will
be more complicated.

Thanx.

"Niek Otten" wrote:

Why not use an extra column (C) and have this formula in D:

=IF(C1="",B1-A1,C1)

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Hector" wrote in message
...
Hi.

Given the following:

A B C
1 5 9 __
2 8 10 __

I'd like for the user to enter values in A and B and have Excel display
B
minus A in C as a DEFAULT value. That is, for row 1, once the user
enters
9
in B, I want to display 4 in C but give the user the option to override
the
calculation. A formula in C won't work because the user would delete
the
formula if he overrides it.

Thanx.

I don't






  #5   Report Post  
Hector
 
Posts: n/a
Default

You're right. I didn't read your post carefully. Sorry.

It's that I was looking for a another solution that did not involve formulas
because the user has the ability to delete unprotected rows. I'm trying some
VB I looked up earlier but am not being able to calculate and display where I
want to.



"Niek Otten" wrote:

I don't see what you mean. If the users enters nothing in C, Excel will
subtract B from A. Only if he enters something in C, then that will be used.
Do I miss something?

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Hector" wrote in message
...
That's a good idea. Though, I would like for the user to enter a value
only
in exceptions. This method would make the user do the calculation which
will
be more complicated.

Thanx.

"Niek Otten" wrote:

Why not use an extra column (C) and have this formula in D:

=IF(C1="",B1-A1,C1)

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Hector" wrote in message
...
Hi.

Given the following:

A B C
1 5 9 __
2 8 10 __

I'd like for the user to enter values in A and B and have Excel display
B
minus A in C as a DEFAULT value. That is, for row 1, once the user
enters
9
in B, I want to display 4 in C but give the user the option to override
the
calculation. A formula in C won't work because the user would delete
the
formula if he overrides it.

Thanx.

I don't








  #6   Report Post  
Jim May
 
Posts: n/a
Default

Paste this into your Sheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns(2)) Is Nothing Then
Target.Offset(, 1).Value = (Target.Value - Target.Offset(, -1).Value)
End If
End Sub

HTH,


"Niek Otten" wrote in message
...
Why not use an extra column (C) and have this formula in D:

=IF(C1="",B1-A1,C1)

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Hector" wrote in message
...
Hi.

Given the following:

A B C
1 5 9 __
2 8 10 __

I'd like for the user to enter values in A and B and have Excel display B
minus A in C as a DEFAULT value. That is, for row 1, once the user
enters 9
in B, I want to display 4 in C but give the user the option to override
the
calculation. A formula in C won't work because the user would delete the
formula if he overrides it.

Thanx.

I don't





  #7   Report Post  
Hector
 
Posts: n/a
Default

It worked. Thanx.


"Jim May" wrote:

Paste this into your Sheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns(2)) Is Nothing Then
Target.Offset(, 1).Value = (Target.Value - Target.Offset(, -1).Value)
End If
End Sub

HTH,


"Niek Otten" wrote in message
...
Why not use an extra column (C) and have this formula in D:

=IF(C1="",B1-A1,C1)

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Hector" wrote in message
...
Hi.

Given the following:

A B C
1 5 9 __
2 8 10 __

I'd like for the user to enter values in A and B and have Excel display B
minus A in C as a DEFAULT value. That is, for row 1, once the user
enters 9
in B, I want to display 4 in C but give the user the option to override
the
calculation. A formula in C won't work because the user would delete the
formula if he overrides it.

Thanx.

I don't






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
Cell Change Color - Need Help alani New Users to Excel 3 June 29th 05 03:50 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Function syntax to compare cell contents ES Excel Worksheet Functions 2 May 18th 05 03:53 PM
How do I get 1 cell calculate only if another cell has an "x" Rochelle B Excel Worksheet Functions 10 May 1st 05 05:06 PM
Default cell alignment Stuart Excel Discussion (Misc queries) 0 April 17th 05 09:41 AM


All times are GMT +1. The time now is 09:38 PM.

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

About Us

"It's about Microsoft Excel"