Selecting a Row base on an array lookup

Mgmarm

New member
Joined
Feb 25, 2015
Messages
7
Reaction score
0
Points
0
Hi Guys,


I am having a problem selecting the corresponding row from a range look up
Sorry if this is a noob question but I am new.. Thanks in advance for anyone who replies much appreciated

Here is my code

Code:
Sub holidaysSelect()

Dim Holiday As Variant, LastCol As Long, c As Range, mcount As Long


With ActiveSheet
    LastCol = .Range("A1").SpecialCells(xlCellTypeLastCell).Column [B]'<--- [B]I added this line to find the last column[/B][/B]             
End With


Holiday = Array("A250", "A251") '<----- [B]Column C:C Contains all the codes and I am trying to look for these two[/B]


For Each c In Intersect(Range("C:C"), ActiveSheet.UsedRange)
    For mcount = LBound(Holiday) To UBound(Holiday)
        If c.Value = Holiday(mcount) Then
           c.Value = Range( '<--- [B]I Want to be able to select the row from Column A to the last column (code above *LastCol*)[/B]     
            Selection.Font.Bold = True       
             With Selection.Interior
              .Pattern = xlSolid
              .PatternColorIndex = xlAutomatic
              .ThemeColor = xlThemeColorLight2
              .TintAndShade = 0.799981688894314
              .PatternTintAndShade = 0 '<---- [B]pulled from macro code I wanted to bold the row and add some color[/B]
                       
            Exit For
        End If
    
    
    Next
Next


End Sub



Thanks again,

M
 
Last edited by a moderator:
Solved

Code:
For Each c In Intersect(Range("C:C"), ActiveSheet.UsedRange)
    For mcount = LBound(holiday) To UBound(holiday)
        If c.Value = holiday(mcount) Then
            Range("A" & c.Row, Cells(c.Row, LastCol).Address).Select
            Selection.Font.Bold = True
 
Last edited by a moderator:
Back
Top