Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2009, 06:08 PM
Registered User
 
Join Date: Jun 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Draw lines to concatenate the value in two cells

Is the a way in VBA to draw a line between 2 cells and that will concatenate the values into one of the cells?

Thanks for any insight.
 
Old August 7th, 2009, 10:20 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Couldn't guess your complete requirement. Here is hint for you:

Code:
ActiveSheet.Shapes.AddLine ActiveSheet.Range("A1").Left, ActiveSheet.Range("A1").Top + 5, ActiveSheet.Range("B1").Offset(0, 1).Left, ActiveSheet.Range("B1").Top + 5

ActiveSheet.Range("A1").Value = ActiveSheet.Range("A1").Value & ActiveSheet.Range("B1").Value
Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old August 8th, 2009, 11:58 AM
Registered User
 
Join Date: Jun 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Thanks for your hint. I appreciate your comments.
Here is a little bit more of the requirement:

I have two columns(column A and column C) of data - about 100 or so rows in each column. Both columns are product names. There are the same products with different names. The user is a product manager that wants to draw a line between a product name in column A that matches up with a product name in column C. The result would be a concatenation that would be place in a cell in Column D adjacent to the matched cel in Cl..

Col A Col C Col D
Widget1 Gizmo4 Widget1 Gizmo14
Widget6 Gizmo4 Widget6 Gizmo4

I am also curious about what event handler I might put the code into...Selection_Changed, Mouse_Down.

Thanks for any additional help you might suggest.
Trebormac
 
Old August 10th, 2009, 04:55 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

If you want to check for all products, then you can better have a new sheet that maps each item in Col A and Col C

if there are any matching items in Col A then Col C will contain the value otherwise it can be empty

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate cells into a variable nori233 Excel VBA 1 January 21st, 2007 06:12 PM
How to draw lines of fix measurements? Abhi.Win BOOK: Professional C#, 2nd and 3rd Editions 0 December 23rd, 2005 01:12 PM
How to draw fix measurement lines Abhi.Win C# 0 December 23rd, 2005 12:43 PM
How can I draw lines on User Forms? BrianWren Excel VBA 4 December 4th, 2004 06:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.