+ Reply to Thread
Results 1 to 6 of 6

If Then statement to new tab

  1. #1
    Registered User
    Join Date
    06-21-2013
    Location
    Arizona, U.S.
    MS-Off Ver
    Excel 2010
    Posts
    23

    Exclamation If Then statement to new tab

    I have a filtered column that sorts through "open, closed, blanks" How can I write an if-then statement so when an item is labeled closed it'll automatically move to a new sheet I created? that way I only show open items on sheet 1?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: If Then statement to new tab

    Formulas cannot affect other cells, and they cannot delete, move, copy 1 cell to another place.

    Why not do this the other way round and pull all the non-closed to another sheet?
    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

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: If Then statement to new tab

    this will still leave all the data on the 1st sheet, just pull what you want to see

  4. #4
    Registered User
    Join Date
    06-21-2013
    Location
    Arizona, U.S.
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: If Then statement to new tab

    How do I "pull" as you are suggesting?

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,705

    Re: If Then statement to new tab

    I would use a helper column on the master sheet which identifies the type of record and allocates a unique ID to each matched record. Then on the Closed sheet your would have formulae that copy the data across (or "pull" it) for each matched record. If you attach a sample workbook I can show you how to achieve that.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Note that the Paperclip icon does not work.

    Hope this helps.

    Pete

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: If Then statement to new tab

    Try this. I creates a small sample - on the same sheet - but it shows the method...
    A
    B
    C
    D
    E
    F
    1
    Header1 Header2 Header1 Header2
    2
    aa Open aa Open
    3
    bb Closed cc
    0
    4
    cc dd Open
    5
    dd Open ff
    0
    6
    ee Closed gg Open
    7
    ff ii
    0
    8
    gg Open
    9
    hh Closed
    10
    ii
    11
    jj Closed

    E2=IFERROR(INDEX(A:A,SMALL(IF($B$2:$B$11<>"closed",ROW($B$2:$B$11)),ROWS($A$1:A1))),"")
    this is an ARRAY formula ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Then copy down and across as needed

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] i have an if then statement that works, how to make it work as a with or case statement
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2016, 03:34 PM
  2. [SOLVED] If statement to select data - nested statement - assistance
    By petitesouris in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-29-2015, 09:55 PM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1