List out only those rows in other sheet which have dates
-
QUESTION: I want to remove unnecessary rows from data listed in excel. I also want the complete list in Sheet2. I just want to list those rows which have dates. Headers, Blank Rows and Other thing should be removed in Sheet2. Can you help? (Here just 4 columns are given I have to work with many more columns, So whatever you suggest make sure it is extendable.) Date Day SunRise SunSet 23/04/2010 Fri 05:49:25 18:49:30 24/04/2010 Sat 05:48:27 18:50:05 24/04/2010 Sat 05:48:27 18:50:05 25/04/2010 Sun 05:47:31 18:51:16 26/04/2010 Mon 05:46:35 18:51:51 27/04/2010 Tue 05:45:40 18:52:27 27/04/2010 Tue 05:45:40 18:52:27 28/04/2010 Wed 05:44:46 18:53:03 29/04/2010 Thu 05:43:53 18:53:38 30/04/2010 Fri 05:43:00 18:54:14 Date Day SunRise SunSet 01/05/2010 Sat 05:42:09 18:54:50 02/05/2010 Sun 05:41:19 18:55:27 ANSWER: Parantap You don't tell me where I am supposed to check for dates. I will assume the column labelled Date is coulumn A Sub copyDateData() Dim r As Range, r1 As Range Set r = ActiveSheet.Columns(1).SpecialCells(xlConstants, xlNumbers) Set r1 = Intersect(ActiveSheet.UsedRange, r.EntireRow) r1.Copy Sheet2.Range("A1") End Sub That worked for me with data like yours given the assumption I stated. It shouldn't need to be extended as it copies all the columns in the used range. If your dates are not in column A then change the 1 to reflect the column where your dates are located. ---------- FOLLOW-UP ---------- QUESTION: Is this VBA? I don't know VBA and Macro. Can you give me simpleformula written in sheet 2 which exctract rows from Sheet 1 those contain Dates. Yes Dates are in Column A.
-
Answer:
Parantap yes that was VBA. The question you asked is very suited for VBA. Doing it with formulas is quite complex and requires Array formulas. in sheet2!A1 you can put in a formula =INDIRECT(ADDRESS(SMALL(IF(ISNUMBER(Sheet1!$A$1:$A$2000),ROW($A$1:$A$2000)),ROW()),COLUMN(),,,"Sheet1")) Enter it with Ctrl+shift+enter rather than just enter Now select it and drag fill it down column A until it start returning Errors (that means you ran out of data on sheet1). then select those cells with the formulas and drag fill to the right for as many columns as you need. You will need to format each column to return the right kind of results. Change the "Sheet1" in the formula to reflect the sheet that contains the source data. If you have problems implementing the formula, send a small sample workbook to me at and I will set it up for you.
Miningco.com Visit the source
Related Q & A:
- How to search events between two dates in WP?Best solution by WordPress
- How to get difference between two dates in years, months and days?Best solution by Stack Overflow
- How to compare dates in Angularjs?Best solution by Stack Overflow
- How do I disable the previous dates in Android custom calendar?Best solution by Stack Overflow
- Which of the following is the correct balance sheet presentation for current assets??Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.