User-defined concatenation
Hi Frank,
Am Tue, 30 Jun 2015 21:09:19 -0400 schrieb Phrank:
There's one other thing about this that I forgot to mention. The
reason I am trying to do this is to create flexibility for users to
label their log entries however they like. Some people do use all 4
items, but others only use 2 or 3. The numbers will be in range
C5:C11, so would I need to loop through that range, and then also loop
through i = 1 to 4?
in this case try:
Function Title(myRng As Range) As String
Dim i As Long, myStr As String
Dim myCnt As Long
With Application
myCnt = .Count(.Index(myRng, 0, 1))
End With
For i = 1 To myCnt
myStr = myStr & "-" & _
Evaluate("=VLOOKUP(" & i & "," & myRng.Address & ",3,0)")
Next
Title = Mid(myStr, 2)
End Function
Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
|