I am currentyly using VB to extract some data sets to another tab in the same workbook. I would like to extract the same data to a new workbook instead upon running the macro. The code I am currently using is:
Sub RunModel()
Dim Events As Range
'
'
Application.ScreenUpdating = False
Set Events = Worksheets("Inputs").Range("L41:L90")
Worksheets("Results").Range("A5:FX5004").Clear
Worksheets("Results").Range("A5009:FX10010").Clear
y = -100
For x = 1 To 50
If Events(x) = "N" Then
GoTo 10
Else
Worksheets("Data").Range("D5").Value = x
Calculate
y = y + 100
Range("RResults").Copy
Worksheets("Results").Cells(y + 5, 1).Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("FResults").Copy
Worksheets("Results").Cells(5009 + y, 1).Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
End If
10 Next x
Application.ScreenUpdating = True
End Sub
Bookmarks