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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some help with validating dates

Status
Not open for further replies.

tinmar

Technical User
Mar 24, 2003
55
HK
Help!!!!!

Can someone help me with this problem. I have some autofilters on sheet 1 and one of the filters filters by date, I want some vba code to say that if cell A1 = 01/01/05, then go to sheet 2 and find the cell in column A that has this date and then copy the whole line to sheet 3.

Please help

thanks
 

There is a VLOOKUP function that would search in sheet2 and bring back whatever cell you need. So for the whole range in cells in sheet3 use this function triggered from an if statement that compares the value on a cell at sheet1 to 01/01/05.
I guess that you loop throu all cells in column A of sheet1, check the value of cell with the if statement and when true, add at the next line of the sheet3 the vlookup formula.



 
tinmar,

UNDERSTAND what you're working with.

Why do Dates and Times seem to be so much trouble? faq68-5827

Skip,

[glasses] [red]Be advised:[/red]To be safe on the FOURTH, don't take a FIFTH on the THIRD, or...
You might not come FORTH on the FIFTH! [bomb][tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top