Hi there,
I have an excel template where I use the loop function to run several simulations and paste the results in an output sheet, and I use the following code. However, I have a situation now where in some iteration one or two rows can be blank, is there anyway to skip the blank rows while running the loop function, such that in the output sheet only rows with value are pasted?
Any help is much appreciated
Sub Output()
Application.ScreenUpdating = False
[ECL_Consol].ClearContents
Dim Temp1 As Integer
Dim i As Integer
Temp1 = Range("ID").Value
For i = 1 To Range("Num_Sims").Value
[ECL_Simulations].Copy
Range("ID").Value = i
Sheets("ECL output - per Loan basis").Select
Sheets("ECL output - per Loan basis").Cells(13 + i, 2).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.StatusBar = ([Num_Sims] - i)
Next i
End Sub
I have an excel template where I use the loop function to run several simulations and paste the results in an output sheet, and I use the following code. However, I have a situation now where in some iteration one or two rows can be blank, is there anyway to skip the blank rows while running the loop function, such that in the output sheet only rows with value are pasted?
Any help is much appreciated
Sub Output()
Application.ScreenUpdating = False
[ECL_Consol].ClearContents
Dim Temp1 As Integer
Dim i As Integer
Temp1 = Range("ID").Value
For i = 1 To Range("Num_Sims").Value
[ECL_Simulations].Copy
Range("ID").Value = i
Sheets("ECL output - per Loan basis").Select
Sheets("ECL output - per Loan basis").Cells(13 + i, 2).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.StatusBar = ([Num_Sims] - i)
Next i
End Sub