Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Removing one column of data and adding another column

I want to have a rolling twelve months of data. For example, I will have
Jul08-Jun09(with Jul08 in column E, Aug08 in Column F and so on until Jun09
is in column P) to start and then progressively add months as they occur. So
when Jul09 comes around I want to automatically add Jul09 to the right hand
side of the data and drop Jul08 (so that I have 12 months of data). Aug 08
(and all the data under Aug 08) would then be in column E and Jul09 in column
P.

I want to get this done automatically and not have to mess around with
cutting and adding etc.

Can anybody point me in the right direction and add any hints. I am unsure
where to start.

I am using Excel 2003.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Removing one column of data and adding another column

In cell E1 enter a date and format that to display Jul-08..in cell F1 Aug-08
until P1. Now try entering information to column Q. Not in Q1...in any of the
cells below...The below macro will assign the header month in Q1 and shift
the cells..

Right click the sheet tab View code and paste the below code in the code
panel...Get back to workbook.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

If Not Application.Intersect(Target, Range("Q:Q")) Is Nothing Then
Range("P1").Copy Range("Q1")
Range("Q1") = DateAdd("m", 1, Range("P1"))
Columns(5).Delete
End If

Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Rodders" wrote:

I want to have a rolling twelve months of data. For example, I will have
Jul08-Jun09(with Jul08 in column E, Aug08 in Column F and so on until Jun09
is in column P) to start and then progressively add months as they occur. So
when Jul09 comes around I want to automatically add Jul09 to the right hand
side of the data and drop Jul08 (so that I have 12 months of data). Aug 08
(and all the data under Aug 08) would then be in column E and Jul09 in column
P.

I want to get this done automatically and not have to mess around with
cutting and adding etc.

Can anybody point me in the right direction and add any hints. I am unsure
where to start.

I am using Excel 2003.

Thanks

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
converting a text column to a number column & removing the ' Gayle from CyberCore Excel Worksheet Functions 2 August 21st 09 05:00 PM
transfer data to another column removing blanks sam Excel Discussion (Misc queries) 8 June 18th 09 07:15 AM
Formatting or removing data within a column GirlFridayCA Excel Discussion (Misc queries) 6 December 3rd 08 08:46 PM
Removing unwanted data in a column nate2345 Excel Discussion (Misc queries) 1 May 1st 06 05:34 PM
Adding Column and removing highest number Tommy Excel Discussion (Misc queries) 2 March 21st 06 04:11 AM


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