Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Macro to add column and insert date then in blank cells copy fromprevious cell

Hello

I hope someone could help me with what I think is a small macro.

I have dates going across the rows but they do not include the weekend
dates.

So in column A it should have 01/01/09 all the way through to half way
through the year being 30/06/09. (This should be changeable.)

The problem I have is that there is no columns for the weekend and
holidays. I only have business dates.

We would need a macro to search along row A to find a missing date.
I.e it jumps from 1 to 3 Jan. It should find that 2 Jan 09 is missing
and then insert a column and insert the date.

In the row immediately underneathe where the date has been inserted I
think need to copy the cell immediately previous to this one.

Can someone please help me with a macro for the above? Sorry if what
I am saying is unclear but I have described it in a way that I think
things should happen.

Thanks in advance,

Best etc

Stuart
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Macro to add column and insert date then in blank cells copy from

Sub addcolumns()

LastCol = Cells(1, Columns.Count).End(xlToLeft).Column

ColCount = LastCol
Do While ColCount 1
If Cells(1, ColCount) Cells(1, ColCount - 1) + 1 Then
Columns(ColCount).Insert
Cells(1, ColCount) = Cells(1, ColCount + 1) - 1
Else
ColCount = ColCount - 1
End If
Loop

End Sub


"Stuart" wrote:

Hello

I hope someone could help me with what I think is a small macro.

I have dates going across the rows but they do not include the weekend
dates.

So in column A it should have 01/01/09 all the way through to half way
through the year being 30/06/09. (This should be changeable.)

The problem I have is that there is no columns for the weekend and
holidays. I only have business dates.

We would need a macro to search along row A to find a missing date.
I.e it jumps from 1 to 3 Jan. It should find that 2 Jan 09 is missing
and then insert a column and insert the date.

In the row immediately underneathe where the date has been inserted I
think need to copy the cell immediately previous to this one.

Can someone please help me with a macro for the above? Sorry if what
I am saying is unclear but I have described it in a way that I think
things should happen.

Thanks in advance,

Best etc

Stuart

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
Insert 3 blank rows wherever the date changes in column???? malycom Excel Discussion (Misc queries) 4 May 21st 09 04:03 PM
Macro to insert sum calculation at every second blank cell for data above in column F [email protected][_2_] Excel Programming 1 July 11th 07 09:34 PM
Start Cell B1 then find first blank cell, insert subtotal, next non blank, then next blank, sutotal cells in between......... [email protected][_2_] Excel Programming 2 June 7th 07 09:27 PM
Insert A blank Row Everytime the date changes in column B Dtown Dawg Excel Discussion (Misc queries) 3 November 15th 06 05:08 PM
Macro to insert copy and insert formulas only to next blank row bob Excel Programming 0 June 30th 06 12:02 PM


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