ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Have VB Code "on" for all workbooks (https://www.excelbanter.com/excel-programming/442850-have-vbulletin-code-all-workbooks.html)

PBG

Have VB Code "on" for all workbooks
 
I have the following code in my personal workbook. How can I get the VB code
to work in all workbooks or do I have to make an add-in?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Union(Target.EntireColumn, Target.EntireRow).Select
'Target.EntireRow.Select
Target.Activate
Application.EnableEvents = True
End Sub

Also, can you change the color?
Thanks

Mike H

Have VB Code "on" for all workbooks
 
Hi,

I'd go with Chip Pearson's rowliner addin

http://www.cpearson.com/excel/rowliner.htm
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"PBG" wrote:

I have the following code in my personal workbook. How can I get the VB code
to work in all workbooks or do I have to make an add-in?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Union(Target.EntireColumn, Target.EntireRow).Select
'Target.EntireRow.Select
Target.Activate
Application.EnableEvents = True
End Sub

Also, can you change the color?
Thanks



All times are GMT +1. The time now is 03:50 AM.

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