Hello,
I am new to VBA. I thought this macro made sense but there are errors. How do I right an IF in VBA that takes any value in the sheet above 0 and only copies and pastes it's values. Please help!
Sub Sample()
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("US Averages")
If score > 0 Then
With ws.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End With
End If
End Sub
I am new to VBA. I thought this macro made sense but there are errors. How do I right an IF in VBA that takes any value in the sheet above 0 and only copies and pastes it's values. Please help!
Sub Sample()
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("US Averages")
If score > 0 Then
With ws.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End With
End If
End Sub