# Increment column range logic

**URL:** <https://forum.uipath.com/t/increment-column-range-logic/771754>\
**Category:** Activities\
**Tags:** studio, excel, activities\
**Created:** [October 7, 2024, 3:30am UTC](https://forum.uipath.com/t/increment-column-range-logic/771754 "2024-10-07T03:30:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aqiffm](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aqiffm/32/504136_2.png) [@aqiffm](https://forum.uipath.com/u/aqiffm)\
**Post date:** [October 7, 2024, 3:30am UTC](https://forum.uipath.com/t/increment-column-range-logic/771754/1 "2024-10-07T03:30:50Z")

</div>

I have a weekly report that I want the bot to automatically generate for me but I want to create a logic for my bot to specifically increment the column range logic.

Initialize variable, variable is a excel column range:  
strStartofWeek = “AZ” (Last thursday)  
strEndofWeek = “BC” (Today, Tuesday)

Is there a way to build a logic to increment column range?

For example:  
Check day if its not Thursday  
New day calculation = “BC” + 1 = “BD”

Once check if its Thursday,  
New week calculation = “AZ” + 7 = “BG”

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [October 7, 2024, 3:34am UTC](https://forum.uipath.com/t/increment-column-range-logic/771754/2 "2024-10-07T03:34:17Z")

</div>

Hi,

The following post will help you.

> [@Writing into next empty cell horizontally (across BO, then BP etc...)](https://forum.uipath.com/t/writing-into-next-empty-cell-horizontally-across-bo-then-bp-etc/713788/2):
>
> Hi, How about the following expression? UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnLetterToColumnIndex("BO")+1) We can also use int32 variable as column index then convert it to alphabet of A1 style when it’s necessary. colIndex = colIndex +1 Then UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(colIndex) Regards,

We can use the following expression.

```
UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnLetterToColumnIndex("BC")+1)

```

Regards,

---

<div class="post-metadata">

**Author:** ![aqiffm](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aqiffm/32/504136_2.png) [@aqiffm](https://forum.uipath.com/u/aqiffm)\
**Post date:** [October 7, 2024, 3:40am UTC](https://forum.uipath.com/t/increment-column-range-logic/771754/3 "2024-10-07T03:40:48Z")

</div>

Bingo man! I dont know what to search but this is exactly what I want. Thank you ya

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [October 10, 2024, 3:41am UTC](https://forum.uipath.com/t/increment-column-range-logic/771754/4 "2024-10-10T03:41:27Z")

</div>

Closed on October 10, 2024, 3:41am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
