+ Reply to Thread
Results 1 to 3 of 3

Default Values

  1. #1
    Registered User
    Join Date
    07-18-2006
    Posts
    27

    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

  2. #2
    Bob Phillips
    Guest

    Re: 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" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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. #3
    Registered User
    Join Date
    07-18-2006
    Posts
    27
    Thanks for the reply, i thought i might have to go down the VBA/Macro route.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1