Solved

Concatenate items from different columns

Posted on 2013-06-02
2
160 Views
Last Modified: 2013-06-09
I'm trying to figure out how to add additional data from different columns. I currently have just column A being displayed. So I'm trying to concatenate additional information from other columns. Along with Column A, I would like to have Column C (Text String) and Column F (Number). I'm retrieving my data from worksheet "Detail" and my code is being run on sheet "Project-Calendar New".  Here is my vba code.


Private Sub Worksheet_SelectionChange(ByVal target As Range)
If Intersect(target, Range("A1:X400")) Is Nothing Then Exit Sub

If target.Count > 1 Then Exit Sub

Dim DataSheet As Range
Dim TargetFound As Range
Dim xRow As Integer
Dim MessageString
Dim exampleDate As Date

Dim target1 As Range
Set target1 = Range("B7:H400")

'This is where my data is coming from?
Set DataSheet = Worksheets("Detail").Range("A2:X400")
Set TargetFound = DataSheet.Find(ActiveCell.Value)

If Not TargetFound Is Nothing Then
xRow = TargetFound.Row

Set DataSheet1 = Worksheets("Detail").Range("A2:A1400")
Set TargetFound1 = DataSheet1.Find(ActiveCell.Value)
If TargetFound1 Is Nothing Then
      
   Exit Sub

Open in new window

0
Comment
Question by:Southern_Gentleman
2 Comments
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 39215310
* There is a Concatenate() function.
* You can write a formula using the ampersand (&) concatenation operator
* I created a Better Concatenate Function and describe it in this article:
http:A_7811-A-Better-Concatenate-Function.html

*  You can do the concatenation in your routine and assign a new .Value property to some cell.
0
 

Author Closing Comment

by:Southern_Gentleman
ID: 39233697
It took a while to look at your project and implement but I figured it. Thanks again.
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

Suggested Solutions

Title # Comments Views Activity
Windows 7 Share with concurrent edits(Excel) 3 32
Office 2016 Excel Issue 4 26
What is format f12.8 for a CSV file 6 40
Sum iF  based on a null cell 11 29
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
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…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

911 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

24 Experts available now in Live!

Get 1:1 Help Now