S
Sibilia
Hi all,
I have a worksheet call X (list of scenario) shown on the screen, and
have a VBA code which should work on another sheet without showing it o
the screen.
my code is:
Sub DeleteScenario()
Dim j As Integer
Dim k As Integer
Dim count As Integer
Dim SavedScenario1
Dim SavedScenario2
SavedScenario1 = Cells(4, "AB").Value
' sheet "list scenario" activated
With Worksheets("Scenario")
j = 3
Do
j = j + 1
SavedScenario2 = .Cells(j, "A")
Loop Until SavedScenario2 = SavedScenario1
.Rows(j).ClearContents
.Range(Cells(j + 1, "A"), Cells(20, "AU")).Copy
* This is where the procedure bug, and I do not understand why*
.Range(j, "A").PasteSpecial Paste:=xlPasteValues
.Range("A20:AU50").ClearContents
End With
End Sub
Many thanks for your help
Sibili
I have a worksheet call X (list of scenario) shown on the screen, and
have a VBA code which should work on another sheet without showing it o
the screen.
my code is:
Sub DeleteScenario()
Dim j As Integer
Dim k As Integer
Dim count As Integer
Dim SavedScenario1
Dim SavedScenario2
SavedScenario1 = Cells(4, "AB").Value
' sheet "list scenario" activated
With Worksheets("Scenario")
j = 3
Do
j = j + 1
SavedScenario2 = .Cells(j, "A")
Loop Until SavedScenario2 = SavedScenario1
.Rows(j).ClearContents
.Range(Cells(j + 1, "A"), Cells(20, "AU")).Copy
* This is where the procedure bug, and I do not understand why*
.Range(j, "A").PasteSpecial Paste:=xlPasteValues
.Range("A20:AU50").ClearContents
End With
End Sub
Many thanks for your help
Sibili