+ Reply to Thread
Results 1 to 9 of 9

default value

  1. #1
    Registered User
    Join Date
    08-19-2006
    Posts
    31

    default value

    any way of entering default value's into cells??

  2. #2
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    Of course. It depends on your requirements, for example:
    Sub auto_open()
    Worksheets("Sheet1").Activate
    Cells(1, 1) = 5
    End Sub
    Best regards,

    Ray

  3. #3
    Registered User
    Join Date
    08-19-2006
    Posts
    31

    didnt quite understand that...

    sorry, i didnt quite understand that- i want to put a default value into cell A5 which would be A4+1 and so on into the rest of the A column...can u help with that please?
    Thanks a lot

  4. #4
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    Enter =A4 + 1 in A5!!!

  5. #5
    Registered User
    Join Date
    08-19-2006
    Posts
    31

    I'm sorry i didnt make it clear enough

    Sorry, I didnt make the problem clear enough, i also have a validation in the column saying that no two values should be the same- if i enter a formula into the cell- the validation doesn't work- i need to be able to have both working---thanks a lot for ur help!

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    Adding to raypayette's code

    Private Sub Workbook_Open()
    Worksheets("Sheet1").Activate
    Cells(1, 1) = 5
    Range("A1:A11").Select
    Selection.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
    Step:=1, Trend:=False
    Range("A1").Select

    End Sub


    this will set the cells each time the book is open, may have to use a dynamic range check out this site for that
    http://www.contextures.com/xlNames01.html#Dynamic

  7. #7
    Bob Phillips
    Guest

    Re: default value

    Validation will work that way. Enter =A4+1 in A5 as suggested will not alter
    the validation, will just be checked against it.

    --
    HTH

    Bob Phillips

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

    "hustla7" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Sorry, I didnt make the problem clear enough, i also have a validation
    > in the column saying that no two values should be the same- if i enter
    > a formula into the cell- the validation doesn't work- i need to be able
    > to have both working---thanks a lot for ur help!
    >
    >
    > --
    > hustla7
    > ------------------------------------------------------------------------
    > hustla7's Profile:

    http://www.excelforum.com/member.php...o&userid=37760
    > View this thread: http://www.excelforum.com/showthread...hreadid=573417
    >




  8. #8
    Gord Dibben
    Guest

    Re: default value

    hustla

    If using the DV formula is: =COUNTIF($A$1:$A$50,A1)=1
    or similar...........................

    Remember, that Data Validation is in effect only when the cell value is changed
    by the user. It does not catch changes made by VBA procedures, or as a result
    of a calculation in a formula. Also, Data Validation does not apply to changes
    made when the user pastes data in to the range.


    Gord Dibben MS Excel MVP


    On Sat, 19 Aug 2006 12:14:18 -0400, hustla7
    <[email protected]> wrote:

    >
    >Sorry, I didnt make the problem clear enough, i also have a validation
    >in the column saying that no two values should be the same- if i enter
    >a formula into the cell- the validation doesn't work- i need to be able
    >to have both working---thanks a lot for ur help!



  9. #9
    Registered User
    Join Date
    08-19-2006
    Posts
    31

    Thumbs up Thank You

    many thanks to all of you that helped me with this problem- the coding was perfect and combining both codes worked fine- thanks so much again!!

+ 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