Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
bob bob is offline
external usenet poster
 
Posts: 52
Default Excel VBA - Has someone already created this

I am looking to create a VBA function that allows you to
select a range of cells and will concatinate the values
from that range into the next cell selected..

Any Ideas????
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Excel VBA - Has someone already created this

Hi
why not use a UDF for this. e.g.
MCONCAT
available in the free add-in Morefunc.xll
(http://longre.free.fr/english/)

--
Regards
Frank Kabel
Frankfurt, Germany


Bob wrote:
I am looking to create a VBA function that allows you to
select a range of cells and will concatinate the values
from that range into the next cell selected..

Any Ideas????

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Excel VBA - Has someone already created this

On Fri, 23 Jul 2004 13:36:23 -0700, "Bob"
wrote:

I am looking to create a VBA function that allows you to
select a range of cells and will concatinate the values
from that range into the next cell selected..

Any Ideas????


Perhaps this UDF will give you an idea. It requires entering the function into
the cell where you want to see the concatenated result.

The first entry is the number of spaces between each cell in the range.
Arguments 2..n can be individual cells or contiguous range references.

=====================
Function SetString(SpacesBetween As Integer, _
ParamArray rg() As Variant) As String
Dim c As Variant
Dim i As Long

For i = 0 To UBound(rg)
Select Case VarType(rg(i))
Case Is = vbArray + vbVariant
For Each c In rg(i)
SetString = SetString & Space(SpacesBetween) & c
Next
Case Is = vbString
SetString = SetString & Space(SpacesBetween) & rg(i)
End Select
Next i

SetString = Trim(SetString)

End Function
==============================


--ron
  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Excel VBA - Has someone already created this

Thank you Both, I've run out of time today, will get back
to it on Monday and post my results... thanks again..
very much
-----Original Message-----
I am looking to create a VBA function that allows you to
select a range of cells and will concatinate the values
from that range into the next cell selected..

Any Ideas????
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Excel VBA - Has someone already created this

On Fri, 23 Jul 2004 23:00:34 +0200, "Frank Kabel"
wrote:

Hi
why not use a UDF for this. e.g.
MCONCAT
available in the free add-in Morefunc.xll
(http://longre.free.fr/english/)


Frank,

Can MCONCAT concatenate non-contiguous ranges?


--ron


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Excel VBA - Has someone already created this

Hi Ron

just testing it and no it does not :-)


--
Regards
Frank Kabel
Frankfurt, Germany


Ron Rosenfeld wrote:
On Fri, 23 Jul 2004 23:00:34 +0200, "Frank Kabel"
wrote:

Hi
why not use a UDF for this. e.g.
MCONCAT
available in the free add-in Morefunc.xll
(http://longre.free.fr/english/)


Frank,

Can MCONCAT concatenate non-contiguous ranges?


--ron

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Excel VBA - Has someone already created this

On Sat, 24 Jul 2004 06:50:28 +0200, "Frank Kabel"
wrote:

Hi Ron

just testing it and no it does not :-)


Thanks. I was not aware of MCONCAT and had written SetString in order to take
care of the issue of non-contiguous ranges. So I guess I did not waste my time
:-).


--ron
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
Linked text boxes created in Excel 2007 are blank in Excel 2003? Robert Lanning Charts and Charting in Excel 0 December 5th 07 08:26 PM
How do I used a big formula I created in Excel? tdjones Excel Worksheet Functions 2 June 22nd 06 07:45 PM
User-defined functions created in Excel 2000 fail in Excel 2003 goodguy Excel Discussion (Misc queries) 1 October 3rd 05 07:04 PM
Excel 2003 crashes loading excel files created Excel 2000 Jeff Lewin Australia Excel Discussion (Misc queries) 0 June 27th 05 04:20 AM
Macros created in Excel 97 Tami Harvey Excel Programming 0 July 29th 03 11:15 PM


All times are GMT +1. The time now is 10:32 AM.

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

About Us

"It's about Microsoft Excel"