View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Complex date VBA - insert a certain weekday

Hi Colin,

Am Tue, 23 Jul 2013 17:29:34 +0100 schrieb Colin Hayes:

With Target
If .Value < "" Then
With .Offset(0, -1)
.Value = Date + 1
'.Columns.AutoFit
End With
Else: .Offset(0, -1).Value = ""
End If
End With
Is it possible to have this place the next Tuesday's date (dd mmm yyyy)
in the cells , instead of the current date?


try:
If Target.Value < "" Then
With WorksheetFunction
Target.Offset(0, -1) = Date + _
.Choose(.Weekday(Date), 2, 1, 7, 6, 5, 4, 3)
End With
'.Columns.AutoFit
Else: Target.Offset(0, -1).Value = ""
End If


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2