ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Repainting a Workbook (https://www.excelbanter.com/excel-discussion-misc-queries/4340-repainting-workbook.html)

cincode5

Repainting a Workbook
 
I have a workbook that contains about a dozen or so Rectangles that are color
formatted with fill effects. I've noticed that whenever I use a pull down
menu, a portions of the Rectangles change color. Its a subtle change of
perhaps a shade or two but its quite annoying. If I switch to another
worksheet then return the image returns back to its normal appearance.

I noticed a VBA command "Repaint", but cannot seem to figure out the correct
syntex. "HELP" say its object.Repaint, but I can't seem to get it to work
when I apply it to a Rectangle. Can someone please tell what I'm doing
wrong, or suggest an alternate method.

Thanks guys...
--
Regards...

Dave Peterson

Maybe you could have a macro that switches to a different worksheet that
switches back.

I've never seen anything like this, but you may want to try it by adding a new
sheet:


Option Explicit
Sub testme01()

Dim CurSelection As Range
Dim ActCell As Range
Dim DummyWks As Worksheet

Set ActCell = ActiveCell
Set CurSelection = Selection

With Application
.ScreenUpdating = False
Set DummyWks = Worksheets.Add
.DisplayAlerts = False
DummyWks.Delete
.DisplayAlerts = True
.Goto CurSelection
ActCell.Activate
End With

End Sub

If that doesn't work, try deleting the .screenupdating lines.

cincode5 wrote:

I have a workbook that contains about a dozen or so Rectangles that are color
formatted with fill effects. I've noticed that whenever I use a pull down
menu, a portions of the Rectangles change color. Its a subtle change of
perhaps a shade or two but its quite annoying. If I switch to another
worksheet then return the image returns back to its normal appearance.

I noticed a VBA command "Repaint", but cannot seem to figure out the correct
syntex. "HELP" say its object.Repaint, but I can't seem to get it to work
when I apply it to a Rectangle. Can someone please tell what I'm doing
wrong, or suggest an alternate method.

Thanks guys...
--
Regards...


--

Dave Peterson


All times are GMT +1. The time now is 02:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com