default value

R

raypayette

Of course. It depends on your requirements, for example:
Sub auto_open()
Worksheets("Sheet1").Activate
Cells(1, 1) = 5
End Su
 
H

hustla7

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

hustla7

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

davesexcel

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
 
B

Bob Phillips

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)
 
G

Gord Dibben

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
 
H

hustla7

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