# Set Range Color

This action is used to set the foreground and background color for a specified range.

## **Properties**

<figure><img src="https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2FDPEWOCFILwFMMLu4pIzZ%2Fimage.png?alt=media&#x26;token=35ddccdd-42ca-4660-8a8f-acf5e314a763" alt=""><figcaption></figcaption></figure>

### **Input**

* **Excel Document**: File name for the target Excel document.
* **WorkSheet**: The target worksheet name.
* **Cell Range**: The target range.
* **Foreground:** The foreground color.
* **Background:** The background color.

{% hint style="info" %}
Both foreground and background colors need to be a **System.Drawing.Color** object.
{% endhint %}

### **Misc**

* **Display Name**: action display name in your implementation project
* **Wait Before**: number milliseconds robot to wait before executing the action.
* **Wait After:** number milliseconds robot to wait until moving to the next action.
* **Abort on Error**: True/False
* **Retry Times**: Specifies the number of times to retry an action if it doesn't end successfully. Default value 0 (no retry); Use -1 if you want to retry indefinitely.&#x20;

## **Use Case**

### **Potential Use Cases**

* Color the headers of an excel file for a better identification.
* Color the columns or rows of an excel file for a better differentiation.
* Color specific cells of an excel file in order to highlight important data.

### **Examples of Using Set Range Color**

**Example**&#x20;

Watch the robot in action:

{% embed url="<https://www.youtube.com/watch?v=3P3rm6z-Yuc>" %}

You can check and download the example from here:

{% file src="<https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2Fo9SXWXaV8EMre63Tk1jK%2FSet%20range%20color.zip?alt=media&token=4893877e-ff37-4083-8c17-1ece02932a19>" %}
