Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

Concatenate items from different columns

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
Southern_Gentleman
Asked:
Southern_Gentleman
1 Solution
 
aikimarkCommented:
* 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
 
Southern_GentlemanAuthor Commented:
It took a while to look at your project and implement but I figured it. Thanks again.
0

Featured Post

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now