Hi all,
I refer to this previous thread:
http://www.excelforum.com/excel-gene...cted-cell.html
The solution works really well however it clears any existing colors in cells eg column headings, etc.
Is there a way around this?
Regards,
Chris.
Hi all,
I refer to this previous thread:
http://www.excelforum.com/excel-gene...cted-cell.html
The solution works really well however it clears any existing colors in cells eg column headings, etc.
Is there a way around this?
Regards,
Chris.
Okay - slightly different approach using transparent shapes. Note, the code is specific to shapes(1) and shapes(2). You may need to change the code if you start at a different point, or just use this as your starting spreadsheet and it should continue to work. Here is the code:
It should work with more than one cell selected, as long as the cells are contiguous. The problem I have with it is that if you select a cell within the shapes, then the shape becomes selected. You could counter this by adding this code:![]()
Please Login or Register to view this content.
but it still does not allow a cell in the highlight to be selected.ActiveHighlight.xlsm![]()
Please Login or Register to view this content.
Pauley
--------
If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).
Thanks Pauley.
This works as requested.
However id only allows 1 step of undo, and does not allow copy/cut and paste.
Also if I copy the code into my spreadsheet which has conditional formatting the code stops at Shapes(2).Top = Target.Top
Maybe I am asking too much.
Thanks for your help though, I will keep searching.
Chris.
I have found this page and my answer.
http://www.tushar-mehta.com/publish_...d%20cell.shtml
The combination of VBA and conditional formatting works.
Thanks,
Chris.
Thanks for sharing what you found. Definitely a cleaner approach. The Undo issue does not surprise me (event handlers sometimes cause that), but I don't know why it would prevent copy and paste (it works for me). As for the code stopping, that is probably because you did not create the rectangle shapes (i.e. the shapes are needed, too, not just the code). As I said, the code is specific to Shapes(1) and Shapes(2). Regardless, much better solution found.
Pauley
Great Code Pauley. I don't address the UNDO issue which is a completely different animal.
See the attached code and sample workbook that addresses the issue of selecting a cell in Shape(1) or Shape(2). The code is a lot more complicated than I originally anticipated.
In the Sheet Module:
In ordinary code module ModCellHighlighting. This is the code based on Pauley's original code.![]()
Please Login or Register to view this content.
In ordinary code module ModScreenFormatting. I put all this code in a separate module because it contains general support routines and because it contains low level interface calls to the Microsoft API (Application Programmer's Interface):![]()
Please Login or Register to view this content.
Lewis![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks