Solved

Function, VBA, Index/Match,  not sure.

Posted on 2015-01-12
7
409 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 32

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 32

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 32

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

895 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

14 Experts available now in Live!

Get 1:1 Help Now