Cell pointer

A

AJ

I have a workbook where information is entered on one worksheet. I have code
written to where based on the information entered rows on another worksheet
in the same workbook are hidden or shown.

Everything works great with one exception.

Now, when that cell is selected, the colored line around that cell that
lets you see which cell you are on... is gone.

There is nothing in my code that turned it off, I"m assuming becasue the
code is running that indicator is not there.

Can someone tell me code to turn it back on?

Thanks in advance,
 
J

JLatham

I suspect your code uses a .Select somewhere and is leaving some other cell
or group of cells selected. Would need to see the code to be certain.
 
A

AJ

Thank you,

here is my code.

Private Sub Worksheet_SelectionChange(ByVal target As Range)

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

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

If Cells(3, 13) = True Then
Worksheets("Printing MBR").Rows("120:175").EntireRow.Hidden = True
Else
Worksheets("Printing MBR").Rows("120:175").EntireRow.Hidden = False
End If
End Sub
 
J

JLatham

Well, I don't see anything in your code that should do that, assuming
"Printing MBR" is a different sheet.

In the meantime, you could add this line of code at the end, just before the
End Sub statement:
Target.Activate

I put your code into an Excel 2003 workbook here, and I don't have any
problem with the selected cell border disappearing. What version of Excel
are you using, and let me know if the added line of code helps any or not.
 
A

AJ

I'm using 2003 - SP3

It is now highlighting just for a second then goes away.

I did look. I have no other code on any other page. I have 2 macros set
up, but those are only for printing and connected to command buttons.

Thanks again for the help.
 
A

AJ

This is only happening on cells/rows where I have data linked to other pages.
This still does not make sense to me. However I have narrowed to scope of
the problem.

Any advise/suggestion is more than welcome.

Thanks.
 
A

AJ

First, thanks again for the help. Whatever the cause, I just found an answer.

At the end of the code I put:

With ActiveCell.BorderAround
End With

That has corrected the problem.

Thanks again
 
J

JLatham

Glad you found a solution. I'm not sure that I'd have ever thought of that
particular command. I still don't have an idea of the actual cause of the
problem in the first place, sorry.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top