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