Line Break Vlookup

J

Jon M.

Hi all,

I have a worksheet using a vlookup based on data validation. I want to do
one of two things with my result. One, I would like the cell with the
formula:

=IF(B6="","",(VLOOKUP(B6,Position,2,0)))

To autofit to the text returned, which would be something like this(this is
the result of my range named "Position", which is already formatted with the
Alt+Enter line breaks):

Ascent 7.5
SIS
OnBase
3270

I have wrap text enabled in cell B8, which is where my formula lies, but it
does not wrap the text unless I manually go into formatting, uncheck wrap
text and recheck wrap text.

Two, my other option which I would be perfectly happy with is if my vlookup
cell B8, could take the return info formatted like this:

Ascent 7.5, SIS, OnBase, 3270

and turn it into this:

Ascent 7.5
SIS
OnBase
3270

And Autofit the contents to the cell with the formula in it.

Basically my big problem is that I cannot get my cell with the formula in it
to wrap text, or autofit the contents it populates with based on the lookup
results. I hope this is sort of clear. Thanks in advance for any
suggestions.
 
G

Gary''s Student

Hi Jon:

After turning on text wrapping on cell B8, you should also widen column B to
the maximum expected and increase the height of row 8 to the maximum expected.

B8 then should respond to as many embedded ALT-ENTERs as the VLOOKUP() picks
up.
 
J

Jon M.

Thanks for the response,

I was hoping there was a way for this to automatically happen to make it
prettier. I have some instance where only one line will be returned in B8,
and some instances where 20 lines may be returned.

I am not huge on the idea of having to format my cell for 20 lines when
sometimes only one line will appear. That's a lot of wasted space if it can
be avoided.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top