I'm trying to loop on each sheet of Worksheets to autofill the first empty column of each sheet based on the values of the last used column of each sheet. Looping for some reason does not work. The autofill is performed only for the first sheet of the workbook. Any ideas why? Thanks!
Here is the code that I use
Sub test_2013_09_22()
For Each msh In Worksheets
Set SourceRange = Range(Cells(1, msh.UsedRange.Columns.Count), Cells(msh.UsedRange.Rows.Count, msh.UsedRange.Columns.Count))
Set fillRange = Range(Cells(1, msh.UsedRange.Columns.Count), Cells(msh.UsedRange.Rows.Count, msh.UsedRange.Columns.Count + 1))
SourceRange.AutoFill destination:=fillRange, Type:=xlFillDefault
Next
End Sub
Bookmarks