Code:
Sub approvePurchase(control As IRibbonControl)
Dim rng As Range
Set rng = Nothing
If (ActiveSheet.Name) = "Purchase List" Then
If Not Application.Intersect(ActiveCell, Range("I2:I600")) Is Nothing Then
If ActiveCell.Value = "Pending" Then
ActiveCell.Value = "Approved"
Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(0, -8)).Copy
Set rng = Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(0, -8)).SpecialCells(xlCellTypeVisible)
With Worksheets("Approved Purchases")
.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Application.CutCopyMode = False
End With
Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(0, -8)).ClearContents
Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(0, 1)).ClearContents
End If
End If
Else
MsgBox "You Do Not Have Permission To Approve Purchases!"
Exit Sub
End If
End Sub
Hi guys,
I know this is a common question, but i don't know the answer for the way i want to use it. I've got the rest of the email macro Praise "Ron De Bruin", however i'm trying to copy the range i've just copied to another sheet into a variable "rng", to then use it in an email sub later on.
However i just can't seem to get it to store the range in a variable, if i can get this working i can use it in my email sub.
Thanks
Last edited: