Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Border around problem



With ActiveCell
.BorderAround LineStyle:=xlContinuous
End With



"AJ" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Border Problem Gizmo Excel Discussion (Misc queries) 2 May 10th 08 03:53 PM
Border Problem Gary''s Student Excel Programming 4 March 13th 08 02:49 PM
Cell border problem Brian Excel Discussion (Misc queries) 2 July 31st 07 07:44 PM
Default Border Color Problem Bobbie Excel Discussion (Misc queries) 1 May 25th 05 06:33 AM
Border problem with one row but no snag in many rows Hari[_3_] Excel Programming 3 September 7th 04 04:32 PM


All times are GMT +1. The time now is 05:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"