# Creating a new risk number

#### Pasty

##### Board Regular
Hi there I was wondering if anyone could point me in the right direction for this problem.

I a list of risk numbers which I am using in a code that will filter actions and run reports off and send them automatically. Each report will have a specific ID number and I was wondering if there was an easy way to generate these.

They will all be stored in a seperate sheet which the user will never see and what I was wanting it to do was to look at the current risk numbers and then add the next one on (with a description of what it relates to next to it) for example if the last ID was Risk 6 it would add Risk 7 at the end of them (N.B. all of them will be in ascending order as I am running a vlookup on them)

Any help would be greatly appreciated.

Regards,

Matt

### Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

#### Lewiy

##### Well-known Member
If your list of risk numbers is in column A on sheet2 then this will add the next one on:
Code:
``````Dim limit As Long
Dim lastnumber As String
limit = Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row
With WorksheetFunction
lastnumber = Val(Right(Cells(limit, 1), Len(Cells(limit, 1)) - .Find(" ", Cells(limit, 1))))
Cells(limit + 1, 1) = "Risk " & lastnumber + 1
End With``````

#### Pasty

##### Board Regular
Thats brilliant - thanks for your help!

Replies
26
Views
864
Replies
1
Views
721
Replies
2
Views
370
Replies
1
Views
681
Replies
0
Views
603

1,191,032
Messages
5,984,248
Members
439,879
Latest member
KingGoulash

### 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.

### Which adblocker are you using?

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

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