+ Reply to Thread
Results 1 to 4 of 4

compare value in cell with multiple

  1. #1
    Registered User
    Join Date
    01-25-2017
    Location
    belgium
    MS-Off Ver
    2010
    Posts
    2

    compare value in cell with multiple

    hey,
    i have next code:
    it looks for :xStr = "W" but now i wan't to look for W and/or "MV" how do i adjust?
    if it founds W or /and MV it does notting, else entire row is hidden.



    Dim telrij As Range
    Dim bereik As Range
    Dim Workbereik As Range
    Dim xStr As String

    On Error Resume Next



    Set Workbereik = Range("G6:z400")

    xStr = "W"

    Application.ScreenUpdating = False
    For i = Workbereik.Rows.Count To 1 Step -1
    Set telrij = Workbereik.Rows(i)
    Set bereik = telrij.Find(xStr, LookIn:=xlValues)
    If bereik Is Nothing Then
    telrij.Hidden = True

    End If
    Next
    Application.ScreenUpdating = True


    End Sub

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: compare value in cell with multiple

    Not elegant but the following should work

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: compare value in cell with multiple

    Or Try this

    Please remember next time to put code tags around your macro (click the # sign on the format bar for the post)

    Please Login or Register  to view this content.
    Bramz

  4. #4
    Registered User
    Join Date
    01-25-2017
    Location
    belgium
    MS-Off Ver
    2010
    Posts
    2

    Re: compare value in cell with multiple

    okay,
    i will try to remember..
    ps THANKS that was realyyyyy fast

+ 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] Need to compare multiple values including TIME between, and compare rate
    By fourmurphys in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-21-2014, 04:37 PM
  2. Replies: 6
    Last Post: 05-30-2012, 03:09 PM
  3. Replies: 1
    Last Post: 07-21-2009, 12:17 PM
  4. [SOLVED] Compare multiple dates, can enumerate cell based on most recent date
    By Brian in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-09-2006, 06:10 PM
  5. Replies: 1
    Last Post: 05-08-2006, 06:55 PM
  6. How do I compare cells and if FALSE compare to next cell in EXCEL
    By Cindie in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-24-2006, 01:35 PM
  7. Compare data - one cell to multiple cells
    By srs710 in forum Excel General
    Replies: 1
    Last Post: 07-20-2005, 07:05 AM
  8. How to compare multiple cell values
    By Chirs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2005, 10:05 AM

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