Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default help with code please

I have a dates in column J and also dates in column K

What I want to do is check each date in column J to make sure there are no
dates in column K that are within 6 days of it.

That is:
J2=01/04/2005
no date in column K can be <07/04/2005

If there are any then possibly create a list of C2 and the C column values
for the records within 6 days.

Hope this makes sense.

Thanks in advance.

Gareth


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default help with code please

sorry, deleted that account a few weeks ago.....

please try:



but removing the "not" after family.

"Otto Moehrbach" wrote in message
...
Your address is not valid. Otto
"Otto Moehrbach" wrote in message
...
The following macro does what you want. You said "within 6 days". That
means <=6 days on either side of the Column J date. IOW, the absolute
value of the difference is <=6 days and both dates get copied to Columns

C
& D.
I am also sending you a small file with this macro placed in the proper
module. I am sending this file to
. If
this
is not a good address for you and you feel you need further help with
this, please post back. HTH Otto
Sub GetDates()
Dim RngJ As Range
Dim RngK As Range
Dim j As Range
Dim k As Range
Dim Dest As Range
Set Dest = [C2]
Set RngJ = Range("J2", Range("J" & Rows.Count).End(xlUp))
Set RngK = Range("K2", Range("K" & Rows.Count).End(xlUp))
For Each j In RngJ
For Each k In RngK
If Abs(j - k) <= 6 Then
Dest = j
Dest.Offset(, 1) = k
Set Dest = Dest.Offset(1)
End If
Next k
Next j
End Sub
"Gareth" wrote in message
...
I have a dates in column J and also dates in column K

What I want to do is check each date in column J to make sure there are
no
dates in column K that are within 6 days of it.

That is:
J2=01/04/2005
no date in column K can be <07/04/2005

If there are any then possibly create a list of C2 and the C column
values
for the records within 6 days.

Hope this makes sense.

Thanks in advance.

Gareth








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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
stubborn Excel crash when editing code with code, one solution Brian Murphy Excel Programming 0 February 20th 05 05:56 AM
option buttons run Click code when value is changed via VBA code neonangel Excel Programming 5 July 27th 04 08:32 AM
VBA code delete code but ask for password and unlock VBA protection WashoeJeff Excel Programming 0 January 27th 04 07:07 AM


All times are GMT +1. The time now is 06:31 PM.

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"