KAPOW

Would you like to react to this message? Create an account in a few clicks or log in to continue.
KAPOW

Welcome to the Kapow forum. Here you can get help, use your skills to help others and enjoy hanging out in the company of other Kapow Robot Developers.


2 posters

    How to write a cell in Excel

    avatar
    JKL


    Posts : 5
    Points : 1919
    Join date : 2019-02-05

    How to write a cell in Excel Empty How to write a cell in Excel

    Post by JKL Sat Mar 16, 2019 9:47 pm

    I am attempting to write into a specific cell in Excel, but am having a problem with the Range Finders.  My robot finds the correct column, then loops through the rows to find the correct row.  I want to insert a value into the intersection of the column and row.  It works fine on the first loop, but on the second loop, it just writes to the same cell as on the first loop.  In other words, it's not dynamically finding the new intersection.  When I try to set the finders I get errors about the ranges being the same.  The user guide talks about using Excel syntax.  I could specify the row and column, but what happens on the next loop?  The column will be the same, but the row changes.


    Last edited by JKL on Sat Mar 16, 2019 9:52 pm; edited 1 time in total (Reason for editing : adding screenshot)
    jking
    jking


    Posts : 103
    Points : 3851
    Join date : 2014-03-01
    Location : USA

    How to write a cell in Excel Empty Re: How to write a cell in Excel

    Post by jking Mon Mar 18, 2019 7:59 pm

    JKL:

    Here is one method:
    I add an Integer variable that I later use to assign a Range Finder for the row I need to update.  In my example I named this variable Iteration.  Set variable to Global.

    Open Excel
    Assign the Starting Row to the Iteration variable.  Note, in my example I know that the starting row has 1 header row, so I assigned starting row = 2.  You may need to adjust this.
    Prior to setting your content, insert a Set Named Range Step.  In my example, I set the Range Name to "Active Row".  The Finder is an Expression "Sheet1!"+Iteration where Sheet1 is your sheet name.
    After Setting Content, insert an Assign Variable Step.  This step is used to assign the next row number.  Expression is Iteration+1
    Thereafter, your active row will be the correct iteration to Set Content.
    Notice in the final screen shot below that the Query is on Iteration 3, but that active row that is being populated is 4.

    How to write a cell in Excel Rowite10
    avatar
    JKL


    Posts : 5
    Points : 1919
    Join date : 2019-02-05

    How to write a cell in Excel Empty Re: How to write a cell in Excel

    Post by JKL Fri Mar 29, 2019 11:37 pm

    Thank you so much for the clear instructions.  I had finally figured out that I had to set a range and got through it, but I am going to work through your example in more detail.

    Sponsored content


    How to write a cell in Excel Empty Re: How to write a cell in Excel

    Post by Sponsored content


      Current date/time is Sat Apr 27, 2024 3:01 pm