+ Reply to Thread
Results 1 to 5 of 5

find non-blank cells and return line with only specific text

  1. #1
    Registered User
    Join Date
    02-10-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    31

    find non-blank cells and return line with only specific text

    Hi All,
    I'm trying to work out how to get the attached spreadsheet to only show the names of those staff who are available on a certain day between certain timeframes.
    The data is generated to an array (W20-W114) which puts a "Y", "N", "B" or "0" into any 2 or more (up to 17) adjacent cells next to the staff member's name.
    I'm trying to get the names of only those staff who have "Y" next to their name in the array, but in ALL the non-blank cells. If there is one or more cells with N,B or 0 then I want the resultant list to ignore that staff member.
    In the attachment, I have included the result I'd like in column G.

    Regards,
    Greg
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: find non-blank cells and return line with only specific text

    Hi Greg,

    This looks like a simple AutoFilter problem to me. See the attached where I selected your data and clicked on the Data Tab then the filter icon. This made it a TABLE with dropdowns to filter on any column you want. Simply filter on the time you want and the names left are those available.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    02-10-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: find non-blank cells and return line with only specific text

    Hi Marvin,
    Unfortunately columns W thru to AN are not static values but variables linked to other pages (which I couldn't attach due to attachment file size limits).
    They change depending on the values in B6, C6, D6 & F6.
    So I'm pretty sure I need some VBA code to provide me with the selective array I require.
    Thanks for your help though.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: find non-blank cells and return line with only specific text

    The data can be static or formulas pointing to other sheets. AutoFilter will work on that type of data too.

    I'd look for a VBA solution last. If non VBA functions can work, it is a much better solution.

  5. #5
    Registered User
    Join Date
    02-10-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: find non-blank cells and return line with only specific text

    Hi Marvin,
    I managed to get the solution using the follwing code (provided by a colleague who noticed my troubles):

    Sub available()
    Dim rng As Range
    Dim col As Integer
    Dim row As Variant
    Dim person As String
    Dim flag As Boolean
    Dim x As Integer
    Dim y As Integer
    Set rng = Range("Availables")
    x = ActiveCell.Column
    'y = ActiveCell.row
    For Each row In rng.Rows
    person = row.Cells(1, 1)
    If person = "-" Then
    Exit Sub
    End If
    flag = False
    For col = 2 To rng.Columns.Count
    If row.Cells(1, col) <> "Y" And row.Cells(1, col) <> "" Then
    flag = True
    End If
    Next
    If flag = False Then
    y = ActiveCell.row
    Cells(y, x).Value = person
    Cells(y + 1, x).Select
    End If
    Next

    End Sub

    Thanks for your assistance

+ 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] Find specific text in a string and return that text
    By K_Red in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-24-2013, 07:50 AM
  2. [SOLVED] Find Specific Text in Text String and Return Value in Adjacent Column
    By watchouse in forum Excel General
    Replies: 2
    Last Post: 07-11-2012, 03:53 PM
  3. Find specific text in column and return cell value from its immediate right
    By cneff in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-08-2012, 07:59 AM
  4. Find specific Text and return a value
    By malnahar in forum Excel General
    Replies: 3
    Last Post: 05-14-2011, 03:05 PM
  5. [SOLVED] Find specific text and return coordinates
    By BOONER in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2006, 04:45 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