View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Phrank Phrank is offline
external usenet poster
 
Posts: 153
Default User-defined concatenation

Hi Claus. Unfortunately, that's still returning a #VALUE! error in my
workbook. I initially tried it in my workbook, and I thought it might
be because the values in column 3 are values that are pulled from
another sheet. But I copied/pasted values to get rid of the formulas,
and that didn't help. However, I made the workbook you created look
exactly like my workbook, and it works just fine (I initially got the
#VALUE error, but when I changed the order, it apparently triggered
the macro and it worked.

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?

I hope I'm not making this too complicated, but I am absolutely
confident this will be pivotal for user adoption as users already have
logs of 100s and 1000s of entries that they've set up a certain way.
Again, and not ever enough, thank you for your help.

Frank

On Tue, 30 Jun 2015 13:51:52 +0200, Claus Busch
wrote:

Hi Frank,

Am Tue, 30 Jun 2015 07:36:24 -0400 schrieb Phrank:

Ah, I see. That makes sense. I've run into a (hopefully minor) snag
with implementation, though. There's a blank line between rows 3 and
4, as shown below (blocks off groups of info (not my formatting, but I
have to work with it). Would I just account for a blank cell in A(i)
and have the loop press on, like below?


if a block always has 4 filled rows you only have to change
myRng.Rows.Count to 4:

Function Title(myRng As Range) As String
Dim i As Long, myStr As String

For i = 1 To 4
myStr = myStr & "-" & _
Evaluate("=VLOOKUP(" & i & "," & myRng.Address & ",3,0)")
Next
Title = Mid(myStr, 2)
End Function

and call the function into the sheet then with:
=Title(A1:C5)


Regards
Claus B.