View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
AJ AJ is offline
external usenet poster
 
Posts: 99
Default Border around problem

I have the following code to hide pages in a worksheet so they don't print
when not needed. If I leave the With Activecell.borderaround code out, for
some reason unknown to me, the border around the active cell disappears.
WHen I put the code in some computers get a RUntime error on the code. I
have checked, we all have SP3 and we all have the same add-ins. Does anyone
have thoughts on correction to this problem?

Thank you,

Private Sub Worksheet_SelectionChange(ByVal target As Range)

If Cells(1, 13) = True Then
Worksheets("Printing MBR").Rows("8:66").EntireRow.Hidden = True
Else
Worksheets("Printing MBR").Rows("8:66").EntireRow.Hidden = False
End If

If Cells(2, 13) = True Then
Worksheets("Printing MBR").Rows("67:125").EntireRow.Hidden = True
Else
Worksheets("Printing MBR").Rows("67:125").EntireRow.Hidden = False
End If

If Cells(3, 13) = True Then
Worksheets("Printing MBR").Rows("126:185").EntireRow.Hidden = True
Else
Worksheets("Printing MBR").Rows("126:185").EntireRow.Hidden = False
End If

With ActiveCell.BorderAround
End With


End Sub