ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select Data by Date Range, Delete Rest (https://www.excelbanter.com/excel-programming/381572-select-data-date-range-delete-rest.html)

Learner

Select Data by Date Range, Delete Rest
 
Dear Experts! Your suggestions are appreciated. Here's the sheet layout.

Column A contains names;
Columns B through CW (99 columns) contain dates in MM/DD/YY format;
Even rows have actual dates, uneven rows - target dates (two rows per name);
Dates are filled out unevenly, some rows may have 50 entries, some only 5,
but there are no blanks between row entries;
Target dates are calculated when the actual dates are entered, so both dates
are always present;
Number of used columns is fixed, number of used rows is not.

VBA code needed to do the following:
Promt the user to enter the start and end date;
Check actual dates (even rows) for a specified date range;
If actual date falls within the range, keep it and keep the target date
right below it;
Delete the rest and shift everything to the left;

Thank you for your help!


Martin Fishlock

Select Data by Date Range, Delete Rest
 
Hi Learner,

This is quite a nice structured learning exercise and you would learn a lot
more by trying to do it first and then ask for comments.

So please try and lets see what you come up with.

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Learner" wrote:

Dear Experts! Your suggestions are appreciated. Here's the sheet layout.

Column A contains names;
Columns B through CW (99 columns) contain dates in MM/DD/YY format;
Even rows have actual dates, uneven rows - target dates (two rows per name);
Dates are filled out unevenly, some rows may have 50 entries, some only 5,
but there are no blanks between row entries;
Target dates are calculated when the actual dates are entered, so both dates
are always present;
Number of used columns is fixed, number of used rows is not.

VBA code needed to do the following:
Promt the user to enter the start and end date;
Check actual dates (even rows) for a specified date range;
If actual date falls within the range, keep it and keep the target date
right below it;
Delete the rest and shift everything to the left;

Thank you for your help!


Learner

Select Data by Date Range, Delete Rest
 
Hi, Martin

I've tried... "Two rows" part and date range enrty are where I got stuck.
It's only a part of the code I'm working on. I'm already on the 11th page of
the code print-out. It was quite simple before it though. This is not my
homework :) and I am not making a living from it. I've learned more from
reading the posts than from the help file or MS tutorials. I'll try some
more... Thanks for your comment.

"Martin Fishlock" wrote:

Hi Learner,

This is quite a nice structured learning exercise and you would learn a lot
more by trying to do it first and then ask for comments.

So please try and lets see what you come up with.

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Learner" wrote:

Dear Experts! Your suggestions are appreciated. Here's the sheet layout.

Column A contains names;
Columns B through CW (99 columns) contain dates in MM/DD/YY format;
Even rows have actual dates, uneven rows - target dates (two rows per name);
Dates are filled out unevenly, some rows may have 50 entries, some only 5,
but there are no blanks between row entries;
Target dates are calculated when the actual dates are entered, so both dates
are always present;
Number of used columns is fixed, number of used rows is not.

VBA code needed to do the following:
Promt the user to enter the start and end date;
Check actual dates (even rows) for a specified date range;
If actual date falls within the range, keep it and keep the target date
right below it;
Delete the rest and shift everything to the left;

Thank you for your help!



All times are GMT +1. The time now is 08:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com