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

Verify the contents of a Range during copy

Status
Not open for further replies.

vestax22

Programmer
Jun 18, 2003
139
0
0
CA
Hi. I have a worksheet containing colums of data. I want to copy data from one worksheet to another in order to create a report. One of the columns I wish to copy contains dates. The other contains data. What I want to do is copy the data column so that only the non blanks are copied. I want to copy the dates that correspond to the data extracted from the other column and paste them inside another worksheet on the same row. In otherwords only the cells containing data are copied with there dates.

Is this clear? Could anybody help me out?
 
just use autofilter and choose non blanks on the dates
Record it and you have your code

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
vestax22,

Another option... Excel menu: Data - Filter - Advanced Filter.

Using VBA and the "Advanced Filter" it's fairly easy to extract a copy of the precise data required - to a separate sheet.

By setting up "criteria" for the extraction, one can be VERY specific in identifying the precise data you require extracted. The criteria can be as simple or as complex as is required - i.e. multi-fields can be referenced, with multi-conditions.

A "bonus" - The Advanced Filter is a "custom" (internal) component and is written in the same C language as Excel. This makes it MUCH faster than other options such as looping through data using VBA looping routines.

What you've described is fairly simple to set up, but ufortunately, Microsoft's documentation on the Advanced Filter is less-than-adequate, and without help it could be a bit of a struggle.

If you would like to email me a scaled-down version of your file (just a handful of records - with any sensitive data replaced with fictitious data), I'll set up the file and get you "jump started". It will be set up so that all you'll have to do is "click a button" to extract a copy of the exact data required, to a separate sheet.

Hope this helps.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Thx for the responses guys. I sent a copy of my application to Dale. Hope he can help me out


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top