<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Get value from cell depending on another value on same row in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-value-from-cell-depending-on-another-value-on-same-row/m-p/12541058#M2006100</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
  &lt;P&gt;I need some help to collect the value from column 1 based on the value in column 4&lt;/P&gt;
  &lt;P&gt;See example:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1997757-example.png" /&gt;&lt;/P&gt;
  &lt;P&gt;So I need to iterate each row to search for the value '000000000000010035'. I'm still trying to learn some Visual Basic looping, but can't get it to work, I have something like this:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;Dim Row as Integer
Dim ConsumptionProfile As String
Dim ValidUntil as Date
Dim Value as String

ConsumptionProfile = "000000000000010035"
Row = 1


' I want this first two rows to be in a loop, so that the Row variable adds +1 for each iteration
session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-LOADPROFILE[4,"&amp;amp;Row &amp;amp;"]").setFocus 'The Focus isn't needed, but I have it here for debugging
Value = session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-LOADPROFILE[4,"&amp;amp;Row &amp;amp;"]").text


'I wan't to exit the script when I have found the correct Value and then check in another cell but on the same Row as above
IF Value = ConsumptionProfile Then
ValidUntil = session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-BIS[1,"&amp;amp;Row &amp;amp;"]").text
ValidUntil = CDate(ValidUntil)&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Would apreciete help with these kind of problem where I need to loop through rows to get a specific value, as I need to do this several times&lt;/P&gt;
  &lt;P&gt;Maybe some sort of exception handling when rows become an empty value (or last row) is also needed&lt;/P&gt;</description>
    <pubDate>Sat, 27 Nov 2021 20:38:12 GMT</pubDate>
    <dc:creator>former_member1265651</dc:creator>
    <dc:date>2021-11-27T20:38:12Z</dc:date>
    <item>
      <title>Get value from cell depending on another value on same row</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-value-from-cell-depending-on-another-value-on-same-row/m-p/12541058#M2006100</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
  &lt;P&gt;I need some help to collect the value from column 1 based on the value in column 4&lt;/P&gt;
  &lt;P&gt;See example:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1997757-example.png" /&gt;&lt;/P&gt;
  &lt;P&gt;So I need to iterate each row to search for the value '000000000000010035'. I'm still trying to learn some Visual Basic looping, but can't get it to work, I have something like this:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;Dim Row as Integer
Dim ConsumptionProfile As String
Dim ValidUntil as Date
Dim Value as String

ConsumptionProfile = "000000000000010035"
Row = 1


' I want this first two rows to be in a loop, so that the Row variable adds +1 for each iteration
session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-LOADPROFILE[4,"&amp;amp;Row &amp;amp;"]").setFocus 'The Focus isn't needed, but I have it here for debugging
Value = session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-LOADPROFILE[4,"&amp;amp;Row &amp;amp;"]").text


'I wan't to exit the script when I have found the correct Value and then check in another cell but on the same Row as above
IF Value = ConsumptionProfile Then
ValidUntil = session.findById("wnd[0]/usr/tblSAPLE_LP_ASSIGNMENTTC_LOAD_PROFILE/ctxtELPASSLP-BIS[1,"&amp;amp;Row &amp;amp;"]").text
ValidUntil = CDate(ValidUntil)&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Would apreciete help with these kind of problem where I need to loop through rows to get a specific value, as I need to do this several times&lt;/P&gt;
  &lt;P&gt;Maybe some sort of exception handling when rows become an empty value (or last row) is also needed&lt;/P&gt;</description>
      <pubDate>Sat, 27 Nov 2021 20:38:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-value-from-cell-depending-on-another-value-on-same-row/m-p/12541058#M2006100</guid>
      <dc:creator>former_member1265651</dc:creator>
      <dc:date>2021-11-27T20:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get value from cell depending on another value on same row</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-value-from-cell-depending-on-another-value-on-same-row/m-p/12541059#M2006101</link>
      <description>&lt;P&gt;Thank you for visiting SAP
Community to get answers to your questions. Since you're asking a question here for the first time, I
recommend that you familiarize yourself with &lt;U&gt;&lt;A href="https://community.sap.com/resources/questions-and-answers"&gt;Community
Q&amp;amp;A&lt;/A&gt;&lt;/U&gt; , as it provides tips for preparing
questions that draw responses from our members.&lt;/P&gt;

&lt;P&gt;For example,
you can:&lt;/P&gt;

&lt;P&gt;- outline what steps you took to
find answers (and why they weren't helpful)&lt;/P&gt;

&lt;P&gt;- share screenshots of what
you've seen/done&lt;/P&gt;

&lt;P&gt;- make sure you've applied the
appropriate tags&lt;/P&gt;

&lt;P&gt;- use a more descriptive subject line.&lt;/P&gt;

&lt;P&gt;The more details you provide, the
more likely it is that members will be able to respond. Feel free to also take
our Q&amp;amp;A  tutorial &lt;A href="https://developers.sap.com/tutorials/community-qa.html"&gt;Q&amp;amp;A tutorial&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Should you wish, you can revise
your question by selecting Actions, then Edit.&lt;/P&gt;

&lt;P&gt;By adding a picture to your Profile
you encourage readers to respond.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Nov 2021 20:38:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-value-from-cell-depending-on-another-value-on-same-row/m-p/12541059#M2006101</guid>
      <dc:creator>former_member751591</dc:creator>
      <dc:date>2021-11-27T20:38:29Z</dc:date>
    </item>
  </channel>
</rss>

