#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Default Values


Is it possible to have a conditional default value, for example, if I
enter a value in one cell, it would automatically add another value.
But it would allow a person to manually override the value without
deleting the formula?

For example..

A1 B1
10 < User enters 11.75 < Excel suggests


--
StevenAFC
------------------------------------------------------------------------
StevenAFC's Profile: http://www.excelforum.com/member.php...o&userid=36471
View this thread: http://www.excelforum.com/showthread...hreadid=562365

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Default Values

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10" '<=== Change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case 10: .Offset(0, 1).Value = 11.75
Case 11: .Offset(0, 1).Value = 11.25
Case 12: .Offset(0, 1).Value = 15
Case 13: .Offset(0, 1).Value = 22
'etc.
End Select
.Offset(0, 1).Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"StevenAFC" wrote
in message ...

Is it possible to have a conditional default value, for example, if I
enter a value in one cell, it would automatically add another value.
But it would allow a person to manually override the value without
deleting the formula?

For example..

A1 B1
10 < User enters 11.75 < Excel suggests


--
StevenAFC
------------------------------------------------------------------------
StevenAFC's Profile:

http://www.excelforum.com/member.php...o&userid=36471
View this thread: http://www.excelforum.com/showthread...hreadid=562365



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Default Values


Thanks for the reply, i thought i might have to go down the VBA/Macro
route.


--
StevenAFC
------------------------------------------------------------------------
StevenAFC's Profile: http://www.excelforum.com/member.php...o&userid=36471
View this thread: http://www.excelforum.com/showthread...hreadid=562365

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
Using Match function with duplicate values in an array Richard Excel Worksheet Functions 3 April 22nd 23 07:45 PM
How do I generate a list from a range of values robo7084 Excel Worksheet Functions 2 July 6th 06 01:48 AM
Setting default values in a drop down list in excel? Dave Excel Discussion (Misc queries) 2 May 18th 06 07:33 AM
resetting excel to default values asiffaleel Excel Discussion (Misc queries) 1 May 3rd 06 09:27 PM
Return Consecutive Values - Pairs Sam via OfficeKB.com Excel Worksheet Functions 6 July 2nd 05 04:43 PM


All times are GMT +1. The time now is 05:49 PM.

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"