cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Philthebill
New Member

How to get "First free Field" of a Column (or workaround) in Excel

Hi there, I have an Excel Document which contains data. The Task is to read from the first 7 Columns, calculate with the data and fill the results in the same row, where it comes from. 

 

"First free row" adds the results AFTER my input data. I tried to work around with filling in an empty Column before the table, but it didnt work.

 

What would work aswell, if I can anyhow make in a loop: Fill in Column 9, field 2 [plus 1 per loop]. Because the fields are always the same. 

 

So for example:
Loop 1 writes to Column 9 Field 2

Loop 2 writes to Column 9 Field 3

Loop 4 writes to Column 9 Field 4
[...]

1 ACCEPTED SOLUTION

Accepted Solutions
Philthebill
New Member

I found my workarount, maybe it helps others.

 

I created a variable before the loop started. Loopcount = 1

Then I added "increase variable" +1 in the loop. So each loop the variable raises.

As last step I added "Write to excelfield Column 9 Row Loopcount

 

Since I have headlines, I need to start with value 1 before the first loop. If you don't have headlines put in 0 or if you want to start later put in the last row number before the first field. 

View solution in original post

2 REPLIES 2
Philthebill
New Member

I found my workarount, maybe it helps others.

 

I created a variable before the loop started. Loopcount = 1

Then I added "increase variable" +1 in the loop. So each loop the variable raises.

As last step I added "Write to excelfield Column 9 Row Loopcount

 

Since I have headlines, I need to start with value 1 before the first loop. If you don't have headlines put in 0 or if you want to start later put in the last row number before the first field. 

Loops have a built in variable called Loopindex for this reason. When I am doing something like Excel with a title row, I will start the LoopIndex at 2 (the first line of data), increment 1, and end at %FirstFreeRow - 1% (the last row of data). This way %LoopIndex% is always my row number. 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (3,723)