Hello,
I know it is possible to copy the non-blanks cells data into another sheet using VB. But is this possible to do using excel formulas?
please let me know.
thanks
Hello,
I know it is possible to copy the non-blanks cells data into another sheet using VB. But is this possible to do using excel formulas?
please let me know.
thanks
Copy, no. Reference with a formula, yes. Can you be more specific?
For example, if you put this formula in A1 and copy to the right and down, it will show all non-blank values in Sheet1.
Formula:Please Login or Register to view this content.
Hard to tell if that's what you mean.
Or, you could apply filters, (ask, if you dont know how to), filter on non-blanks, copy what remains to the new location, remove/undo filters. You could even record a macro to do that for you
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Here is example of VBA code
This code filters data in Sheet 4 as per criteria cell is blank in column 3 and copy paste selection to sheet5.Please Login or Register to view this content.
Regards,
Tanja
Last edited by 6StringJazzer; 06-11-2015 at 07:17 AM. Reason: corrected error in code tags
Correction, previous code was returning blank. This one should be OK
Please Login or Register to view this content.
Try this...
Sheet1
A 1 Header 2 Data1 3 Data2 4 5 6 Data3 7 Data4 8 9 Data5 10
Sheet2
A 1 Header 2 Data1 3 Data2 4 Data3 5 Data4 6 Data5 7
This array formula** entered in A2:
=IFERROR(INDEX(Sheet1!A:A,SMALL(IF(Sheet1!A$2:A$10<>"",ROW(Sheet1!A$2:A$10)),ROWS(A$2:A2))),"")
** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
Copy down until you get blanks.
Biff
Microsoft MVP Excel
Keep It Simple Stupid
Let's Go Pens. We Want The Cup.
You would need to extend the range in the formula. In the sample formula I only reference down to A10. Extend this as needed.
thanks. it worked
You're welcome. Thanks for the feedback!
If your question has been solved please mark the thread as being solved.
In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks