When adding new columns, is it possible to delete older ones?

aworth

New Member
Joined
Jul 20, 2011
Messages
3
Hello,

I'm working on a project at work that creates a excel spreadsheet looking at different stocks for different days. I need the spreadsheet to contain information for only the most recent 30 days. I am wondering whether there is a way that when I add new columns for new days that older columns will self-delete. What I'm trying to say is, for example, say that I am entering information for August 1st and the stocks that I am monitoring for that day, I am wondering if there is a way to delete the items that I was looking at on July 1st automatically. I figure that this would occur upon the creation of new columns that older ones would be deleted automatically. I need to consolidate the information because I want to be able to quickly look at the information and can't take the time to go through hundreds of reports. Another solution that may be possible would be a time limit upon the columns. I am curious as to whether it would be possible to delete columns after a certain length of time is reached. I hope that one of these is possible. Thank you for your help.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Essentially, I would like to know if there was a way that when I go to add new columns for each day, a buy column and a sell column for stocks I would like to know, well, 1. If there was a way when I add these new columns if the last two in the excel sheet could automatically get deleted and 2. if there is an easy way to have columns inserted automatically. It's quite a pain for me to manually add columns especially when I'm out of the office for a few days and need to update multiple days. For instance I just had to do five days and I had to add 10 columns to 4 seperate worksheets. If any additional information could be helpful in answering let me know. Thanks.
 
Upvote 0
Sounds like you have your Data setup to also act as your Report page.

Standard data tables have new information added to the bottom. Then you can "run reports" from this data to a separate report sheet.
Advanced Filtering can be setup to build a report on the data and leave the original table alone.
Advanced Filter allows you to preset filter options.
It also allows you to filter by criteria in ways standard autofilter can not do. You can choose an export location in the dialog box or in VBA code.
Once you setup the code and criteria, you can use a macro button to copy specific data from your main sheet to a "Report" sheet. The original data remains unchanged and the data "Filtered" to another page can be used as desired.

Good example of Advanced Filter steps here:
http://www.contextures.com/xladvfilter01.html

AdvancedFilter Video Demo here:
http://www.contextures.com/xlVideos04.html
http://www.contextures.com/xlVideos04.html#AdvFilt2007
Another good link with sample VBA code here:
http://www.meadinkent.co.uk/xlfilter.htm
 
Upvote 0

Forum statistics

Threads
1,224,504
Messages
6,179,144
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top