Add new rows and auto fill a sequence in them cells added

myuglymush

New Member
Joined
Jul 22, 2019
Messages
1
Hi all

I'm wondering if you could help or at least suggest options. I have looked through loads of threads and have been able to add rows using a message box but I need to then autofill them cells added with a sequence.

Sub MyInsertRows()

Application.DisplayAlerts = False

Dim i, NumRows As Integer
Dim m As Boolean


NumRows = InputBox("How many ID's do you wish to insert?")
For i = 1 To NumRows
Rows(17).Insert
Next i

Application.DisplayAlerts = True

End Sub

Thats the code I use to add the rows.

Tthen I have an ID I need to populate these rows I've just made with the next in sequence of the ID

ID-2210-MS-FS-220719

ID-(Just 2 predefined letters) 2210-(this is the sequence number, so next row would have 2211 etc etc) MS- (Initials of the Person using the ID-looking to make this change according to who wants the ID but thats the next step) FS-(Again just 2 predefined letters) and finally the date these IDs added. DDMMYY

Above Row 17 I add details of the sheet and extra information etc.

sorry if I haven't exactly explained this very well. :(

ta
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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
Back
Top