SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Senior Member
    Join Date
    Feb 2001
    Location
    USA
    Posts
    776
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    GetRowWithCellText not returing correct row number

    Friends,

    I have a WebTable which has following data:

    <font class="small">Code:</font><hr /><pre>
    Column1
    Row1 FI - Admin
    Row2 FI
    </pre><hr />

    msgbox B.P.WebTable(a).GetRowWithCellText("FI")

    Actual Result: 1
    Expected Result: 2
    Thanks,
    Prashant Patel

  2. #2
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: GetRowWithCellText not returing correct row nu

    <font class="small">Code:</font><hr /><pre>
    RowNum = 1
    Do Until RowNum = -1
    RowNum = B.P.WebTable(a).GetRowWithCellText("FI",,RowNum )
    If B.P.WebTable(a).GetCellData(RowNum,ColumnNUm) = "FI" Then
    Exit Do
    End If
    Loop
    Msgbox RowNum</pre><hr />

  3. #3
    Senior Member
    Join Date
    Feb 2001
    Location
    USA
    Posts
    776
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: GetRowWithCellText not returing correct row nu

    or I just created this function.

    <font class="small">Code:</font><hr /><pre>
    Function u_GetRowWithCellText(sTextToSearch,iCoulmnNumber)
    iTotalRow=B.P.WebTable.RowCount
    For i = 0 to iTotalRow
    If trim(ucase(B.P.WebTable.GetCellData(i,1))) = ucase(sTextToSearch) then
    u_GetRowWithCellText= B.P.WebTable.GetCellData(i,iCoulmnNumber)
    Exit for
    end if
    Next
    End Function
    </pre><hr />
    Thanks,
    Prashant Patel

  4. #4
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: GetRowWithCellText not returing correct row nu

    The difference between above techniques is My code goes to the the rows that has specified text, but your code loop through all the rows.

  5. #5
    Senior Member
    Join Date
    Feb 2001
    Location
    USA
    Posts
    776
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: GetRowWithCellText not returing correct row nu

    I am sorry. I see your point now.
    Thanks,
    Prashant Patel

  6. #6
    Senior Member
    Join Date
    Feb 2001
    Location
    USA
    Posts
    776
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: GetRowWithCellText not returing correct row nu

    Is there a way I can pass below Object Hierarchy as a parameter: B.P.WebTable
    Thanks,
    Prashant Patel

  7. #7
    Member
    Join Date
    Jan 2007
    Posts
    472
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: GetRowWithCellText not returing correct row nu

    yes you can create an object of this table

    set oTable = B.P.WebTable

    Call u_GetRowWithCellText(oTable ,sTextToSearch,iCoulmnNumber)

    and use oTable instead of B.P.Table

  8. #8
    Senior Member
    Join Date
    Feb 2001
    Location
    USA
    Posts
    776
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: GetRowWithCellText not returing correct row nu

    I just tried following and it worked.

    <font class="small">Code:</font><hr /><pre>
    Function u_GetRowWithCellText(objBPW,sTextToSearch,iCoulmnN umber)
    iTotalRow=objBPW.RowCount
    For i = 0 to iTotalRow
    If trim(ucase(objBPW.GetCellData(i,1))) = ucase(sTextToSearch) then
    u_GetRowWithCellText= objBPW.GetCellData(i,iCoulmnNumber)
    Exit for
    end if
    Next
    End Function
    </pre><hr />

    msgbox u_GetRowWithCellText(B.P.WebTable,"FI",1)
    Thanks,
    Prashant Patel

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:21 PM.

Copyright BetaSoft Inc.