I want to make my custom VBA function accept only a single-cell argument. What is the rightway of doing it:
myCell as Cell
or:
myRange as Range
and get (how?) the left-upper cell by default?If you select more than one cell the function will exit:
Function AcceptOneCell(rng As Range)
If (rng.Cells.Count > 1) Then
AcceptOneCell = "Only allow 1 cell"
Exit Function
End If
' your code here
End Function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With