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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Users online (3,738)