Solved

Function, VBA, Index/Match,  not sure.

Posted on 2015-01-12
7
324 Views
Last Modified: 2015-01-14
Hi Experts,

Tried to research the solution that I need but not sure  what to look for.  I looked at index/match but that doesn't seem to work. I would like to take the data from columns R-AA on the OrigFormat tab of the attached workbook and return it to column F of the Selection tab with a hard return for each column menu item.   Is this possible to do?
ee-2015-Food-Vendor-v1.xlsm
0
Comment
Question by:jmac001
  • 3
  • 2
  • 2
7 Comments
 
LVL 12

Expert Comment

by:Alan3285
ID: 40545962
Bit messy, but for a one-off, would this work (entered into Selection!F2):

=OrigFormat!R2&CHAR(10)&OrigFormat!S2&CHAR(10)&OrigFormat!T2&CHAR(10)&OrigFormat!U2&CHAR(10)&OrigFormat!V2&CHAR(10)&OrigFormat!W2&CHAR(10)&OrigFormat!X2&CHAR(10)&OrigFormat!Y2&CHAR(10)&OrigFormat!Z2&CHAR(10)&OrigFormat!AA2

Copy down as required.

See  attached Version 2 of your file.

ee-2015-Food-Vendor-v2.xlsm

Alan.
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 40546500
A fairly simple VBA or User Defined Function would do this for you.

Not sure on proper syntax but along the lines of:

TextString = Range(R2).Value & CHR(10)
For Each Cell in Range(S2:AA2)
TextString = TextString & Cell.Value & CHR(10)
Next Cell

Thanks
Rob H
0
 

Author Comment

by:jmac001
ID: 40547443
Alan,

Is there any way to get the blank lines out?
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 12

Assisted Solution

by:Alan3285
Alan3285 earned 200 total points
ID: 40547993
Hi,

You can wrap the formula in CLEAN:

=CLEAN(OrigFormat!R2&CHAR(10)&OrigFormat!S2&CHAR(10)&OrigFormat!T2&CHAR(10)&OrigFormat!U2&CHAR(10)&OrigFormat!V2&CHAR(10)&OrigFormat!W2&CHAR(10)&OrigFormat!X2&CHAR(10)&OrigFormat!Y2&CHAR(10)&OrigFormat!Z2&CHAR(10)&OrigFormat!AA2)

See attached Version 3.

Alan.
ee-2015-Food-Vendor-v3.xlsm
0
 
LVL 31

Accepted Solution

by:
Rob Henson earned 300 total points
ID: 40548856
See attached file with macro and User Defined Function options.

UDF is on original Selection sheet, entered as =Collate(OrigFormat!R2:AA2) and then copied down. This works but you have to enter each cell and force a recalculate; select cell, press F2 and press enter. Tedious and I don't know how to get round this one.

I ran the macro option on copy sheet, Selection(2). Clear contents of column F and then run the Macro by pressing Alt & F8 and then choose Collate2 and click Run.

Both assume that the two sets of data match row for row on both sheets.

Thanks
Rob H
ee-2015-Food-Vendor-v1.xlsm
0
 

Author Closing Comment

by:jmac001
ID: 40549344
Thank you both for solution both they both work really well and I would be able to duplicate for use in different spreadsheet. Alan, I chose  Rob's solution as the best because it will allow me to work with the data. I won't have to paste as values so that I can make formatting changes to some of the menu line items.
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 40549994
Formatting changes can only be applied after the macro option unless you copy and paste the udf results as values.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now