Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default VBA to concatenate Text and/or Numbers and/or dates etc

2003

What function(s) in VBA could I use to treat the contents of any cell as text, so that, I could
concatenate all of the information.

C1 = Chicago
D1 = is
E1 = 252
F1 = miles
G1 = 7/24/2006

Therefo
A1 = C1&D1&E1&F1&G1 (Of course this formula does not work because the data is inconsistent)

Complicating matters is that columns C thru G can have any type of data.

Is this a hopless case?

Thanks EagleOne
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default VBA to concatenate Text and/or Numbers and/or dates etc

In excel, you could use a formula like:
=c1 & " " & d1 & " " & e1 & " " & f1 & " " & text(g1,"mm/dd/yyyy")

If you wanted VBA, you could use J.E. McGimpsey's multicat user defined
function:
http://mcgimpsey.com/excel/udfs/multicat.html

You'll see that J.E. relies on the .Text property (not .Value).

and you'd use:
=multicat(c1:G1)

in your cell

wrote:

2003

What function(s) in VBA could I use to treat the contents of any cell as text, so that, I could
concatenate all of the information.

C1 = Chicago
D1 = is
E1 = 252
F1 = miles
G1 = 7/24/2006

Therefo
A1 = C1&D1&E1&F1&G1 (Of course this formula does not work because the data is inconsistent)

Complicating matters is that columns C thru G can have any type of data.

Is this a hopless case?

Thanks EagleOne


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default VBA to concatenate Text and/or Numbers and/or dates etc

Thanks David

Dave Peterson wrote:

In excel, you could use a formula like:
=c1 & " " & d1 & " " & e1 & " " & f1 & " " & text(g1,"mm/dd/yyyy")

If you wanted VBA, you could use J.E. McGimpsey's multicat user defined
function:
http://mcgimpsey.com/excel/udfs/multicat.html

You'll see that J.E. relies on the .Text property (not .Value).

and you'd use:
=multicat(c1:G1)

in your cell

wrote:

2003

What function(s) in VBA could I use to treat the contents of any cell as text, so that, I could
concatenate all of the information.

C1 = Chicago
D1 = is
E1 = 252
F1 = miles
G1 = 7/24/2006

Therefo
A1 = C1&D1&E1&F1&G1 (Of course this formula does not work because the data is inconsistent)

Complicating matters is that columns C thru G can have any type of data.

Is this a hopless case?

Thanks EagleOne

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM
Text Wrapping JMB Excel Discussion (Misc queries) 0 July 29th 05 02:41 AM
how do I concatenate text that has a quotation mark sparkroms Excel Discussion (Misc queries) 2 July 8th 05 09:20 PM
space between text strings with concatenate Jeff Excel Discussion (Misc queries) 2 March 3rd 05 06:54 PM
Autofitting a row Josephine Excel Discussion (Misc queries) 2 March 3rd 05 03:37 PM


All times are GMT +1. The time now is 02:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"