View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default custom validation off workbooksheet_change

Hi Steve

This should give you the correct formula:

MyFormula= _
"=And(Len(F" & Target.Row & ")=8,IsNumber(Value(Left(F" & Target.Row &
",6))),Right(F" & Target.Row & ",2)=""" & "P6""" & ")"

Regards,
Per

"Steve Roach" skrev i meddelelsen
...
I have a worksheet_change macro to place the date and time in adjacent
cells of the target column(which is the "B" column). I now want to put a
custom validation in the "F" column of the same row. How can I work off the
target to make the formula dynamic?
The custom validation formula is:
=and(len(F3)=8,isnumber(value(left(f3,6))),right(f 3,2)="P6"
I've tried to replace the "F" address's with something like:
len(target.address.offset(0,4)=8
and
I've tried making the "f" cell the active cell and using:
len(activeCell)=8
Both failures
Any help out there?
Thanks
Steve

EggHeadCafe - Software Developer Portal of Choice
Slipstreaming and Unattended Windows Media Creation
http://www.eggheadcafe.com/tutorials...d-unatten.aspx