ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Function to set borders of cell (https://www.excelbanter.com/excel-worksheet-functions/23326-function-set-borders-cell.html)

Des

Function to set borders of cell
 

Is it possible to have a UDF which will set the borders of a cell based
on its (or another cell's) value.
Conditional formatting is good but I am restricted to one line width.
Des


--
Des
------------------------------------------------------------------------
Des's Profile: http://www.msusenet.com/member.php?userid=690
View this thread: http://www.msusenet.com/t-1870083718


David McRitchie

A function can only return a value -- doesn't matter if it is a
builtin function for Excel or VBA or if it is a UDF. A function
cannot change formatting of any cell, nor can it change the
value of another cell.

You would need a macro and more specifically, probably an
event macro. If the value of the cell being changed is by
changing it manually and not from a formula you would probably
want to use a a Change Event macro.
http://www.mvps.org/dmcritchie/excel/event.htm#change
Record a macro to get an idea of the code you need to use.

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Des" wrote in message ...

Is it possible to have a UDF which will set the borders of a cell based
on its (or another cell's) value.
Conditional formatting is good but I am restricted to one line width.
Des


--
Des
------------------------------------------------------------------------
Des's Profile: http://www.msusenet.com/member.php?userid=690
View this thread: http://www.msusenet.com/t-1870083718





All times are GMT +1. The time now is 08:46 PM.

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