Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Inserting Dates

Hi I am lookinf for some help with coding this.

if cell a1 is a date then
if cell a2 is a date then
if a2-a1 = 1 then
rw=rw+1
else
insert (a2-a1) rows
rowadd=1
for each row inserted do
(a2-a1)rows = a1+rowadd
rowadd=rowadd+1
loop
rw=rw+1
endif
else
rw=rw+1
endif
rw=rw+1
endif

anybody have any thoughts on how to help me do this?
Thanks.


--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Inserting Dates

Assuming the dates start in A1 as in your example:

Sub AddDates()
Dim i As Long
i = 1
Do While Cells(i + 1, 1) < ""
If Int(Cells(i + 1, 1)) Int(Cells(i, 1)) + 1 Then
Rows(i + 1).EntireRow.Insert
Cells(i + 1, 1) = Int(Cells(i, 1)) + 1
End If
i = i + 1
Loop
End Sub

--
Regards,
Tom Ogilvy


"shhhhh" wrote in message
...
Hi I am lookinf for some help with coding this.

if cell a1 is a date then
if cell a2 is a date then
if a2-a1 = 1 then
rw=rw+1
else
insert (a2-a1) rows
rowadd=1
for each row inserted do
(a2-a1)rows = a1+rowadd
rowadd=rowadd+1
loop
rw=rw+1
endif
else
rw=rw+1
endif
rw=rw+1
endif

anybody have any thoughts on how to help me do this?
Thanks.


--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-



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
Inserting dates function ArthurN Excel Worksheet Functions 4 January 11th 09 02:37 PM
Inserting Dates without years, please help!! Erich Excel Discussion (Misc queries) 2 June 20th 08 08:57 PM
Inserting Dates JDay Excel Discussion (Misc queries) 2 June 2nd 06 01:30 PM
Inserting dates JDay Excel Discussion (Misc queries) 2 June 1st 06 01:40 PM
Inserting Dates JDay Excel Discussion (Misc queries) 2 May 31st 06 12:58 PM


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