Hi, gonsalvr!
You can try this, if it's suitable for you.
Let's say your new public PatientID is in column A (if not, change to proper value in following code where it says 'kiIDColumn = ...'), and that it has a formula like "=ROW()-X+Y" unquoted, where X is the number of header lines and Y+1 the number from which you want to start automatic numeration.
Let's say your worksheet name is "Hoja1" unquoted (if not, change to proper value in following code where it says 'ksSheet = ...').
Insert a new module (Alt-F11, Insert, Module) and copy this code in the upper right pane:
-----
[pre]
Code:
Option Explicit
Sub TransformFormulaIntoValue()
' constants
Const ksSheet = "Hoja1"
Const kiIDColumn = 1
' declarations
Dim I As Long, J As Long, K As Long
' start
If ActiveSheet.Name <> ksSheet Then Exit Sub
' process
With Selection
For I = 1 To .Rows.Count
J = I + .Row - 1
K = Cells(J, kiIDColumn).Value
If K > 0 Then
If Cells(J, kiIDColumn).HasFormula Then Cells(J, kiIDColumn).Value = K
End If
Next I
End With
' end
End Sub
[/pre]
-----
What does this code do? Nothing until you...:
a) press Alt-F8 from within sheet "Hoja1" and choose run "TransformFormulaIntoValue" macro
b) assign it to a button control (or command button) and click it
What does this code do when you execute it?
It operates on column kiIdColumn of sheet ksSheet and only on cells corresponding to selected cells (one or multiple cells), and it changes the formula by its value, fixing it and keeping it constant for future uses.
How/when should you use this procedure?
First, if you have 100 patients copy the formula for column A to 120 rows, select the first 100 and execute the macro: this will leave all actual patients with a constant invariable ID and reserve place for future additions.
Second, each time you add a new patient, select any cell of its row, and execute the macro: this will change its formula value into constant.
Hope it helps you. Just advise if any trouble.
Regards!