Format 000 yy 001

Papi

Well-known Member
Joined
May 22, 2007
Messages
1,592
I have cells in column A that require formatting to show a rig number, the year and an assigned job number using a macro looks at the last highest number and adds one number to arrive at the next job. So 123 09 623 would be rig 123 in the year 2009 and is on job number 623. What I have done up until now is formatted the cell to show 123 09 (to be changed annually) and then ran a macro to copy two hidden rows (English and Russian) and took those to the bottom and the macro would add one more number i.e.

Application.ScreenUpdating = False
Application.Goto Reference:="R1C1:R2C1"
ActiveCell.Rows("1:2").EntireRow.Select
Selection.Copy
Selection.End(xlDown).Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.EntireRow.Hidden = False
ActiveCell.Select
ActiveCell.FormulaR1C1 = "=MAX(R3C:R[-1]C)+1"
ActiveCell.Range("A1:B1").Select
Selection.Copy
ActiveCell.Range("A1:B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Application.ScreenUpdating = True
ActiveCell.Offset(0, 3).Range("A1").Select
End Sub

I now have to turn this over to another group and would like to simplify it by choosing the year from =Today() and maybe the rig nimber from a cell say K5. And then have the job number assigned based on the last highest number, plus 1.

Any ideas?
 

Some videos you may like

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Watch MrExcel Video

Forum statistics

Threads
1,122,719
Messages
5,597,734
Members
414,170
Latest member
Mdm

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
Top