Append Sequencing to Existing Record

breynolds0431

Active Member
Joined
Feb 15, 2013
Messages
303
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Let's say I have a table of notes where there's a person that creates the note and another that responds. Each created note is assigned a record number and added to a table. The recipient's response is added to the same row the note was created in. If the note creator wants to come back and add additional comments to a note, I was thinking it would be easiest to add a new row with a record number that would associate with the original note. In the below example, a follow up note to Note ID 1.00 could be listed as Note ID 1.01. Or the formats could be completely different, such as "1-0" for the original and "1-1" for follow up. Obviously there could be an infinite back and forth occurring in regards to a single Note ID.

Note IDNote Subject
1.00Missing Cross-Ref
2.00Invalid Date Used

I currently have a userform, where there is a combolist that populates with all the whole numbers in the column with the Note IDs. That way they can select the particular note they wish to add follow up to. The problem is I can't seem to figure out how to find the highest sequencing in a particular parent Note ID. For example, let's say parent Note ID 1.00 had 6 follow ups, whereby there should now be a Note ID of "1.06". Is there a loop or find function that would see that the next sequential note would need to be "1.07"?

Thank you for your time reading through this.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
if your table is named "Table1" and the listcolumn is "number" then the largest number between 1 and 2 is :
if the answer is "-9e99" (very large negative number), then there is no number in that range.
VBA Code:
Sub test()
     mynumber = 1
     my_largest = Evaluate("=max(if((" & mynumber & "<=table1[number])*(table1[number]< " & mynumber + 1 & "),table1[number],-9e-99))")
     MsgBox "largest number >= " & mynumber & " and <" & mynumber + 1 & " is " & my_largest
End Sub
 
Upvote 0
Solution
Sub test() mynumber = 1 my_largest = Evaluate("=max(if((" & mynumber & "<=table1[number])*(table1[number]< " & mynumber + 1 & "),table1[number],-9e-99))") MsgBox "largest number >= " & mynumber & " and <" & mynumber + 1 & " is " & my_largest End Sub
Works perfectly. Thanks!
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,520
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top