Jump to content

Worksheet Formula to Increment a Record ID


Recommended Posts

Is there a way to reference the cell directly above and add 1 to it? This is easy in Excel, but it doesn't seem to work in VW.

 

I would like to use this to incrementally assign numbers to the ID field on equipment items across many layers. 

 

Thanks!

Link to comment

This works just fine in a Spreadsheet type cell, but it will not work in a Database type cell.

 

If you wanted to increment column A and cell A1 has a value of 1 the formula would be

 

=A1+1

 

If you copy that formula and paste it into a range of cells, the row number will automatically increment in each row giving:

 

=A2+1

=A3+1

 

etc.

 

HTH

Link to comment

There is no easy way to use a formula between different database rows. Since the database can be sorted by different columns, it has no real way of knowing what row is above or below. You certainly would not want your objects renumbered just because someone changed the sort order of the database.

 

If the column has a ='Record'.'Field' type formula, you could select a range of number from a set of spreadsheet cells (in the same or in a different database and then Copy/Paste it into the cells you want to renumber. In VW2025 you can just select the first cell and Paste and it will paste down to match what is on the clipboard.  Previous versions you may have to match the size of the Copy and Paste regions.

 

HTH.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...