sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Count excel rows

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 792 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      davesexcel
      last edited by

      I am opening putting data in an excel workbook, I am counting the rows with

      rw=ws.range("1;1").specialcells(11)
      

      Then add the code to the row below

      	ws.Cells(rw.row+1,1).Value = a
      	ws.Cells(rw.row+1,2).Value = b
      	ws.Cells(rw.row+1,3).Value = d
      	ws.Cells(rw.row+1,4).Value = rs
      	ws.Cells(rw.row+1,5).Value = rise
      

      This works as intended but the cell that has formatting is considered not empty.

      In excel vba I would use

      rw=cells(rows.count,1).end(xlup).row
      

      This will find the last row with something in it in column 1 and does not include formatting, such as borders.
      Is there an equivalent to this in Ruby?

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        Generally: Ruby can only use Excel via the WIN32OLE class, which just wraps OLE Automation. So it should be similar to VBA. In fact, I myself have this MS page bookmarked as the reference to use for WIN32OLE <-> Excel interaction:
        Object model (Excel VBA reference)

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • Dan RathbunD Offline
          Dan Rathbun
          last edited by

          More Specifically: Would the Range.Find method help?
          Range.Find method

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement