may be try:
Sub dRILLDOWN()
call realdRILLDOWN("Drill Down")
call realdRILLDOWN("Forecast")
end sub
Sub realdRILLDOWN(mysheet as string)
Dim x, i As Long, y, ii&, j&, k&
Application.ScreenUpdating = 0
With Worksheets("Drill Down") 'may be here With Worksheets(mysheet)
y = .Range("F8:S" & .Cells.Find("*", , , , xlByRows, xlPrevious).Row)
End With
With Worksheets("Source Data")
x = .Range("A1:B" & .Cells.Find("*", , , , xlByRows, xlPrevious).Row)
End With
With Worksheets(mysheet)
' the rest
edit: almost the same way ;-) but as always slightly different way to skin the cat.
Notice other type of argument, other way to call procedure with argument and my doubts about serching for value of y - shall it be always taken from Drill Down sheet? Can imagine that it shall do this way. Or shall it be determined as other value for Forecatst sheet - also pausible.
Bookmarks