View Single Post
 
Old 02-22-2017, 05:10 PM
wlcdo2 wlcdo2 is offline Windows 7 32bit Office 2016
Novice
 
Join Date: Jun 2016
Posts: 17
wlcdo2 is on a distinguished road
Default

Thanks for the guidance NoSparks.
Your suggestion about using the range for the loop and CountIf lead me to a new test by simply searching for a specific string value which worked just fine. I therefore declared a new string (in my example called FindMe based on rngList) and this now works perfectly! My new code is:
Code:
Private Sub ShowShapes()
    Dim rngList As Range
    Dim FindMe As String
    Dim ws As Worksheet
    Set ws = Worksheets("Workings")
    Set wsRange = ws.Range("O2:W10")
    For Each rngList In wsRange
        FindMe = rngList
        If Application.CountIf(wsRange, FindMe) > 0 Then
            Me.Shapes(FindMe).Visible = True

        Else
        End If
    Next rngList
  
End Sub
With regards to the shape, I'm working with a simple Oval but I didn't have to specify the type; it worked just fine per my code above.

Thanks again NoSparks for pointing me on the right direction, much appreciated!
Reply With Quote