Solved

Concatenate items from different columns

Posted on 2013-06-02
2
151 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
Comment Utility
* 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
Comment Utility
It took a while to look at your project and implement but I figured it. Thanks again.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

762 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

11 Experts available now in Live!

Get 1:1 Help Now