ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Visual BASIC in Excel (https://www.excelbanter.com/excel-worksheet-functions/155963-visual-basic-excel.html)

Emerogork via OfficeKB.com

Visual BASIC in Excel
 
I can write the code but wonder where to place it and how to activate it in a
spread sheet.
I hope to run the code when the value in a cell changes.

How do I control the cell background color in VB code? Specifically, I wish
to change from grey to crosshatch when someone clicks on the cell. (Maybe
there is a better way without using VB?)

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1


FSt1

Visual BASIC in Excel
 
hi,
I would put the code in the worksheet change event.

Cells(1,1).interior.colorindex = 40
or
range("A1").interior.colorindex = 40

see this site for excel color indexes.
http://www.mvps.org/dmcritchie/excel/colors.htm

regards
FSt1


"Emerogork via OfficeKB.com" wrote:

I can write the code but wonder where to place it and how to activate it in a
spread sheet.
I hope to run the code when the value in a cell changes.

How do I control the cell background color in VB code? Specifically, I wish
to change from grey to crosshatch when someone clicks on the cell. (Maybe
there is a better way without using VB?)

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1




All times are GMT +1. The time now is 07:20 AM.

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