How can I find the row ID of next open row in VBA?
I have VBA code that loops through rows and can give me the row number and row ID of populated rows. It doesn't help me get the next available ID so I can do a put request and add data to an empty row. Currently the VBA just pulls the last populated ID and overwrites it each time. Is there a way to get this??
Answers
-
The rows that have not been used yet do not have a row ID to pull.
-
Is there a statement or something I need to add to my PUT command that tells it to write to next available row?
-
Here is the API documentation on adding new rows to a sheet:
https://smartsheet.redoc.ly/tag/rows#operation/rows-addToSheet
EDIT: For some reason it is really struggling to provide a hyperlink, so here is a text string of the url I was trying to provide…
https://smartsheet.redoc.ly/tag/rows#operation/rows-addToSheet
-
Thank you, I tried using the toBottom like the documentation states:
inputData = "[{" & """toBottom"": true," & """cells"":[{""columnId"":""" & cDDR & """, ""value"":""test ddr 2""}]}]"
but I kept getting an error message that it was unable to add because an attribute was missing. I just assumed the attribute was the rowID because I can't get that to work, and if I replace that with an ID it works fine.
-
Just loop through the sheet twice. The first time build a table with row number and ID. Then when you walk through the sheet you can look up the ID for the next row.
/marc
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives