Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Static date not working using VBA

I am trying to insert a static date into column P (from p7 down) if the adjacent column is populated. I need it to remain blank otherwise and the O column is a select-able drop down list.
the code I'm trying to use is as follows but it wont seem to work.
can anyone please advise

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("O7:O50000")) Is Nothing Then
With Target(1, 2)
.Value = Date
.EntireColumn.Autoit
End With
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Static date not working using VBA

Hi Joe,

Am Fri, 6 Nov 2015 03:16:52 -0800 (PST) schrieb Joe Clarke:

I am trying to insert a static date into column P (from p7 down) if the adjacent column is populated. I need it to remain blank otherwise and the O column is a select-able drop down list.
the code I'm trying to use is as follows but it wont seem to work.
can anyone please advise


try:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("O7:O50000")) Is Nothing _
Or Target.Count 1 Then Exit Sub

With Target.Offset(, 1)
.Value = IIf(Len(Target) 0, Date, "")
End With
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DAYS360 where Start Date is Static and End Date is Latter of Two Dates Aimee Shaw Excel Discussion (Misc queries) 1 December 28th 09 10:34 PM
Static date Hernan Excel Discussion (Misc queries) 8 April 13th 08 05:12 PM
static date Alan g1bdu Excel Worksheet Functions 2 July 3rd 07 12:35 AM
Static Date Jesse Excel Discussion (Misc queries) 1 September 14th 06 10:24 AM
DATE STATIC Shaggy Excel Worksheet Functions 5 August 22nd 06 02:13 AM


All times are GMT +1. The time now is 05:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"