+ Reply to Thread
Results 1 to 5 of 5

Checking

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Checking

    Hi I have an excel file with lots of tabs, now the column B of all the tabs contains SA or TA. Is there a way to generate a sheet with the tab name and the value of column B.

    For example:
    Sheet Value
    TA001 SA
    TA002 Both (As SA & TA are both present)
    CO007 Both
    TA009 TA

    I am attaching an extract of my data for your reference.Please guide me,
    thanks,me
    Attached Files Attached Files

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Checking

    If you have the sheet names in column A of your summary sheet, you could use this formula and drag down.
    =CHOOSE(SIGN(COUNTIF(INDIRECT(A1&"!B:B"),"SA"))+2*SIGN(COUNTIF(INDIRECT(A1&"!B:B"),"TA")) +1, "neither", "SA","TA", "both")
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Re: Checking

    Amazing & perfect, thanks a ton mikerickson,
    Can you kindly make a vba code do the same thing as the file is a system generated file and there are many sheets, and I don't have the summary sheet with all the names populated.
    a vba code than can do the same thing will be a great help & also I can use it in future.
    Thanks a ton ! :D Godbless

  4. #4
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Re: Checking

    Any help thanks friends.
    Last edited by fatalcore; 07-01-2012 at 06:24 AM.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Checking

    Dim ws As Worksheet, oneSheet as Worksheet
    
    With ThisWorkbook
        Set ws = .Worksheets("Summary")
        ws.Range("A:A").ClearContents
        ws.Range("A1:B1").Value = Array("Sheet Name", "Status")
    
        For Each oneSheet in .Worksheets
            if oneSheet.Name <> ws.Name Then
                ws.Range("A1000").End(xlUp).Offset(0,1).Value = oneSheet.Name
            End If
        Next oneSheet
        With ws
            With Range(.Cells(2, 1), .Cells(.Rows.Count,1).End(xlup)).Offset(0, 1)
                .FormulaR1C1 = "=CHOOSE(SIGN(COUNTIF(INDIRECT(RC1&""!B:B""),""SA""))+2*SIGN(COUNTIF(INDIRECT(RC1&""!B:B""),""TA"")) +1, ""neither"", ""SA"",""TA"", ""both"")"
            End With
        End With
    End With

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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