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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,745)