I select varying sheets in my workbook and run the macro LastPriceSheets below. B47 of each sheet either contains a price or just 0. When 0, I want to skip the price copy and move on to Next. The problem is the copy happens every time and not skipping on 0.
Sub LastPriceSheets()
Dim sht As Worksheet
For Each sht In ActiveWindow.SelectedSheets
Call LastPrice
Next
Wrapup:
Sheets("Last-Price").Select
End Sub
-----------------------------------------------------------------
Sub LastPrice()
Start:
If Range("$B$47").Value = 0 Then
GoTo Wrapup
Else
End If
MovePrice:
Range("$B$47").Select
Application.CutCopyMode = False
Selection.Copy
Range("B10").Select ' <-- Before running, manually change("Bnn") to corresponding month when month changes.
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Wrapup:
Range("$A$3").Select
Application.CutCopyMode = False
End Sub
------------------------------------------------------------------------------------------------------------------
Sub LastPriceSheets()
Dim sht As Worksheet
For Each sht In ActiveWindow.SelectedSheets
Call LastPrice
Next
Wrapup:
Sheets("Last-Price").Select
End Sub
-----------------------------------------------------------------
Sub LastPrice()
Start:
If Range("$B$47").Value = 0 Then
GoTo Wrapup
Else
End If
MovePrice:
Range("$B$47").Select
Application.CutCopyMode = False
Selection.Copy
Range("B10").Select ' <-- Before running, manually change("Bnn") to corresponding month when month changes.
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Wrapup:
Range("$A$3").Select
Application.CutCopyMode = False
End Sub
------------------------------------------------------------------------------------------------------------------