Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select The Beginning and End Dates

Status
Not open for further replies.

scottie1

Programmer
Dec 12, 2003
50
GB
Hi Folks

I've got a spreadsheet with dates in a column (they could be listed in any column). Where ever the dates start and end (rows) I want to be able to select all of the data adjacent to it and copy it into a new work sheet. The dates must run from a beginning of a month to an end of a month and must not be less than 5 months of rows, if you get what I mean.

Cheers y'all

Scottie1
 
what have you tried to do so far??

A good idea would be to search these forums (including FAQ's) for ways of looping through a range of cells, looking for the values and comparing this to a previously stored value.

You will also find some code to do copy and paste, so don't think you need help on this particular bit.

basic flow is

loop
compare
valid
select
copy
paste
end loop




Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Scottie1,

Your requirement really is not clear.

Why not consider using PivotTable, which is a reporting feature of Excel. No copy 'n' paste required.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
basicaly I just want a little bit of code just to select the first date on a spreadsheet ie 01/01/2003 and highlight down to the last date ie 03/01/2003 then highlight across to the last column, copy it and paste it into a new sheet. There is normally about a whole year to select (366 rows) and usually 48 columns across. the date column is not always in column A:A it could start in C:1, but where ever it starts from it will always go down to either 365 or 366 rows (depending on the year) and always 48 columns.

column AA
01/01/2003
02/01/2003
03/01/2003
 
Code:
Sheet1.[A1].Copy Destination:=Sheet2.[A1]


Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Code:
Sheet1.[A1].CurrentRegion.Copy Destination:=Sheet2.[A1]


Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top