Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Macro to find odd due dates and move them

All dates are in column E but the data that i get has
9/1/2006
9/10/2006 odd due date this would be moved to column F.
and the due date in column E would be changed to 10/1/2006.
So on odd due dates we forward the date to the first day of the next month.
What i would like to do i create a macro that goes thought Colunm E and moves
all dates that are not the fist of the month to column F in the same row and
change the date in column E to the first of the next month.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200612/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Macro to find odd due dates and move them

jln via OfficeKB.com wrote:
All dates are in column E but the data that i get has
9/1/2006
9/10/2006 odd due date this would be moved to column F.
and the due date in column E would be changed to 10/1/2006.
So on odd due dates we forward the date to the first day of the next month.
What i would like to do i create a macro that goes thought Colunm E and moves
all dates that are not the fist of the month to column F in the same row and
change the date in column E to the first of the next month.

You can use this:

Sub Nik_test()
For z = 1 To Sheet1.UsedRange.Rows.Count
With Sheet1
If Day(.Cells(z, 5)) < 1 Then
.Cells(z, 6) = .Cells(z, 5)
.Cells(z, 5) = DateSerial(Year(.Cells(z, 6)), _
Month(.Cells(z, 5)) + 1, 1)

End If
End With
Next

End Sub

If you have a header row on your column, change the z=1 to... to z=2 to...

Nik
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
Macro to find and move column andrea Excel Discussion (Misc queries) 1 October 9th 08 02:22 PM
Find account, move them to different sheet MACRO brodiemac Excel Discussion (Misc queries) 3 July 24th 08 07:49 PM
Macro - Find a value and then move down Phil Osman Excel Discussion (Misc queries) 4 August 10th 05 01:20 PM
macro to find numeric data & move it Steve Simons Excel Programming 2 July 16th 05 11:56 AM
Macro to find the 6th occurrence and move range cynthia Excel Programming 0 January 22nd 04 03:48 AM


All times are GMT +1. The time now is 11:43 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"