Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro and Background Color

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to write a macro that will return a numerical value to a background colour in a cell. In other words if 15 is entered into the cell the background colour changes to BLUE but if 20 is entered the cell changes to red etc. Any ideas?
 
Hi gibsonj,

Try this:

Assign a range name to the cell. I have used "cel", but you can use whatever name you desire ...except for the small number of "reserved names" which Lotus has. Stay away from using those names (consult Lotus's HELP if required).

Then using the following code, assign the code to a button or to a Keyboard Letter. To assign the code to a keyboard letter, use Slash Range Name Create, followed by the BackSlash character (\), followed by a keyboard letter. For example if you use the letter "A", you would activate the code by holding down the code and hitting "A".

Assign the "\A" Range Name to the top cell where you place the following code:

{IF cel=15}{STYLE-INTERIOR 104}
{IF cel=20}{STYLE-INTERIOR 80}

The above colors will produce blue and red. But if you wish to change the shade of blue or red, or use other colors, consult the color table you get when you "right click" on any cell, choose "Lines and Color", and then choose "Background Color". Then to determine the number of the color, click on a color and HOLD DOWN THE left mouse cursor. You will notice that as you move the cursor from color to color, it will show the number for the different colors. Whichever color you prefer, use that number in your code.

Hope this is helpful. Let me know.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top