2013-03-31 2 views
0

내 열의 마지막 열까지 강조 표시하려면이 코드를 어떻게 적용 할 수 있습니까? 내 경우 엔 EntireRow가 아닌 ​​"J"입니까?마지막 열까지 행 강조 표시

For Each wb In Workbooks 
    If wb.Name <> "Book1.xlsm" Then 
    wb.Activate 

    For Each ws In ActiveWorkbook.Worksheets 
     Set cl = ws.Cells.Find(What:=SearchString, _ 
     After:=ws.Cells(1, 1), _ 
     LookIn:=xlValues, _ 
     LookAt:=xlWhole, _ 
     SearchOrder:=xlByRows, _ 
     SearchDirection:=xlNext, _ 
     MatchCase:=False, _ 
     SearchFormat:=False) 
      If Not cl Is Nothing Then 
       FirstFound = cl.Address 
      Do 
        cl.EntireRow.Interior.ColorIndex = Cor 
       Set cl = ws.Cells.FindNext(After:=cl) 
     Loop Until FirstFound = cl.Address 
      End If 
    Next ‘ etc etc 

답변

2

변경에
cl.EntireRow.Interior.ColorIndex = Cor
:
ws.Range("A" & cl.Row & ":J" & cl.row).Interior.ColorIndex = Cor

+0

안녕, @Ross McConegghy, 감사! –

+1

환영합니다. 필요한 모든 열의 강조 표시를 시작하고 끝내려면''A''와'': J "'를 바꿀 수 있습니다. 내 대답을 받아 주셔서 감사합니다 =) –