sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Count excel rows

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 810 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