?
Solved

Function, VBA, Index/Match,  not sure.

Posted on 2015-01-12
7
Medium Priority
?
477 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 13

Expert Comment

by:Alan
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 33

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 13

Assisted Solution

by:Alan
Alan earned 800 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 33

Accepted Solution

by:
Rob Henson earned 1200 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 33

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
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…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

777 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