I'm quite new to vba, and somehow I can't figure this one out. I'm trying to find out what the default values of vba method parameters are, because I would like to shorten my script (and not having to define it all the time).
As an example
Sheets(ComboBox1.Value).Columns(2).Find(What:="Example", _ LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=False) I'm using these same parameters quite a lot in a subroutine, and would like to spare myself the hassle of writing them out every time. If they were the default values anyway I could just drop them. But I can't find what the default values for this method are anywhere.
So I've come up with defining my own
Public Function FindVal(What As Variant, Optional After As Variant, _ Optional LookIn As Variant = xlValues, Optional LookAt As Variant = _ xlPart, Optional SearchOrder As Variant, Optional SearchDirection As _ Variant = xlNext, Optional MatchCase As Boolean = False, Optional _ MatchByte As Boolean, Optional SearchFormat As Variant) FindVal = Find(What=What, After=After, LookIn=LookIn, LookAt=LookAt, _ SearchOrder=SearchOrder, SearchDirection=SearchDirection, _ MatchCase=MatchCase, MatchByte=MatchByte, SearchFormat=SearchFormat) End Function But I'm sure there's an easier way, right?
Much obliged for any help!
