# Increment Form and Revision Number with Hyphen in Between.

#### USFengBULLS

##### Board Regular
Hello,

I am looking at many examples online on how to auto increment Invoice / Form number but they aren't specific to what I need to do.
The format to number my forms is (Change Order #) - (Revision #). Example, If I were on the fourth revision of change order three, it would be 3-4.
I need to write two codes for two different situations.

The first code needs to increment the change order number, the value to the left side of the hyphen i.e. 1-0, 2-0, 3-0, 4-0

The second code will need to increment the revision number, the value to the right side of the hyphen i.e. 1-1, 1-2, 1-3, 1-4

I had 1-0 in the cell to test and wrote a simple Range("B7") = Range("B7") + 1 and of course it did not work. I already have a place to put these codes that resets the form depending on if its a new change order, or a revision to a change order. I just need some help with the actual code that would increment the number to left only or the number on the right only.
How would I write the code for both of these?

### Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

#### jtakw

##### Well-known Member
Hi,

Is this what you mean:

Book1
ABCD
1Left onlyRight only
21-02-01-1
Sheet512
Cell Formulas
RangeFormula
C2=LEFT(A2,FIND("-",A2)-1)+1&MID(A2,FIND("-",A2),99)
D2=LEFT(A2,FIND("-",A2))&MID(A2,FIND("-",A2),99)+1

#### USFengBULLS

##### Board Regular
Yes, Exactly. But I need it to do this in two separate VBA Codes so I can have it run with other codes/events that I already have happening.

Replies
5
Views
149
Replies
4
Views
126
Replies
4
Views
170
Replies
0
Views
155
Replies
3
Views
121

1,195,624
Messages
6,010,751
Members
441,568
Latest member
abbyabby

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