View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
jasontferrell jasontferrell is offline
external usenet poster
 
Posts: 56
Default Applying formatting to non-continuous named ranges

Try using Intersect. This will apply the format to the intersection
of the column you want with the named range:
Change:
Range(Cells(StartRow, Col),cells(EndRow,Col)).locked = False
To:
Intersect(Range("OutputRng"),Cells
(StartRow,Col).EntireColumn).Locked = False
Change:
Range(Cells(StartRow, Col), Cells(EndRow, Col)).locked =
True
To:
Intersect(Range("OutputRng"),Cells(StartRow,
Col).EntireColumn).Locked = True