Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

copy row to different sheet with one critera (Column K = on, off)

0

I need help with this formula:

I would like to have, From column "K", the whole row show up on the "ON sheet" if it has "on" in the column and then if it has 'OFF" in the column to show up on the "off" sheet in the same workbook but have the data show up in two different sheets?

(I deleted and changed my data because it is personal information)

I've been trying to use the different lookup formulas and have had no luck. 

Thank you.

Answer
Discuss

Discussion

Hi Heather

Not sure which formula you refer to since no file was attached. If you intended to attach an image or screen grab, please note that is not catered for.

You can attach an Excel file by editing your question and using the Add Files... button (below the text box).

Sounds like you may need VBA to do what you want. Do you have experience if that?
John_Ru (rep: 6142) Apr 26, '21 at 4:40 pm
Sorry I have uploaded the file now. 
 
heather00 (rep: 10) Apr 26, '21 at 4:42 pm
Please consider this argument:- It is clear that you will never, ever be able to see the ON and OFF sheets at the same time (unless you print them). Therefore you will never, ever need both of them at the same time (even for printing). Therefore you don't need either sheet until you want to look at it. Therefore your target should be to provide the sheet when you want it instead of in case you want it. With that in mind, it's clear that either sheet should be prepared at the very last minute so that includes the most recent updates from the Master sheet, or be kept in permanent sync. Permanent sync can best be achieved using VBA. It isn't commendable for the reason given above: you don't need it, and it's a waste of resurces to keep it ready :just in case". But you can use VBA also to prepare the sheet on the fly, for example, when you click on the tab to look at it. Excel's own solution to your problem is contained in the Filter function which John has explained in his answer below. This meets all your requiremnts. You can look at it or print it and it's always up to-date. However, it needs 4 or 5 clicks instead of the one click you prefer. If this convenience is significant for you the answer is to add a button to the Master which you cick to set the filter. The action would be executed using VBA.
Variatus (rep: 4889) Apr 26, '21 at 8:17 pm
Good point Variatus, thanks. Plain filtering avoids the problem of ON OFF sheets becoming out of sync with the Master sheet. I'll modify my answer to point Heather and other users to that approach.
John_Ru (rep: 6142) Apr 27, '21 at 2:54 am
Add to Discussion

Answers

0

Heather

You have some non-VBA choices but not using a formula:

As Variatus, points out in the discussion above, using Excel's built-in filtering is the easiest solution to viewing (and printing) subsets of data. It also avoids the problem of your ON OFF sheets becoming out of sync with the Master sheet. 

In Excel 2013 I think you'd need to click somewhere in the data then select menu Data > Filter. Autofiltering wil be applied (down arrows on each column heading). Then click the down arrow on column K, uncheck (Select All) to clear all of the check boxes then check the ON box (or OFF to see only those rows). That will leave you with a filtered view which can be printed. You can even hide column K and the filtering will remain.

If, for some reason, that approach cannot work for you and you really need a snapshot of ON and OFF rows, the simplest way is to make a copy of your sheet Master (with your cursor over the Tab, right-click, pick Move or Copy... then check Create a copy and where you want it). On that new sheet, apply Auto Filter so you get the down arrows on  all the column headings.

If you want column K for ON, click on the filter arrow and uncheck ON. Then select all the visible rows and (on a row number), right click and pick Delete. Remove the filters and you're left with only the ON rows.

Do the same but unchecking OFF etc.

A neat way is covered in Don's tutorial here: Filter While Leaving Original Data Intact in Excel but the limitation is that the filtered data can't be created in another sheet- you have to create it in the same sheet. You could then copy/paste into another sheet or in your ON sheet say set each cell formula to = a cell from that range in your Master sheet. 

Achieving your goal with using formula would be trickier, lead to a large file and need filtering anyway I think. I'm guessing that you're not familiar with VBA so haven't suggested a solution using macros.

Hope this helps.

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login