Hi there,
I would like to use a macro to add multiple lines into each tab and I got this code:
It works fine with adding the required amount of rows, but all rows been added to the first sheets.
Could anyone please help me with this?
I would like to use a macro to add multiple lines into each tab and I got this code:
VBA Code:
Sub InsertRows()
'
'
'Insert x rows
Worksheets("Worklist").Unprotect Password:="readpads"
Worksheets("Tech 1").Unprotect Password:="readpads"
Worksheets("Tech 2").Unprotect Password:="readpads"
Worksheets("Tech 3").Unprotect Password:="readpads"
Worksheets("Reported Results").Unprotect Password:="readpads"
Dim Rws As Variant
Rws = InputBox("How many rows")
If Rws = "" Then Exit Sub
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
Rows("8:10").Select
Selection.EntireRow.Hidden = False
Rows("9:9").Copy
Range("10:10").Select
ActiveCell.EntireRow.Resize(Rws).Insert Shift:=x1Down
Rows("9:9").Select
Selection.EntireRow.Hidden = True
Range("A10").Select
Next ws
End Sub
It works fine with adding the required amount of rows, but all rows been added to the first sheets.
Could anyone please help me with this?