Hello all,
I have this VBA code:
This works great, no problems whatsoever, but I was curious, in the interest of becoming better with my code, is there a way to shorten that code as I am doing the same thing to the same range of sheets?
Many thanks
I have this VBA code:
VBA Code:
Sheets(1).Select
Rows("1:1").Copy
Sheets(4).Rows("1:1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets(5).Rows("1:1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets(6).Rows("1:1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets(7).Rows("1:1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets(8).Rows("1:1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets(9).Rows("1:1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets(10).Rows("1:1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets(4).Cells.EntireColumn.AutoFit
Sheets(5).Cells.EntireColumn.AutoFit
Sheets(6).Cells.EntireColumn.AutoFit
Sheets(7).Cells.EntireColumn.AutoFit
Sheets(8).Cells.EntireColumn.AutoFit
Sheets(9).Cells.EntireColumn.AutoFit
Sheets(10).Cells.EntireColumn.AutoFit
Many thanks