PC Review


Reply
Thread Tools Rate Thread

Copy Name Range in single Cell

 
 
Dhimant
Guest
Posts: n/a
 
      15th Nov 2008
Hi,

I had create a NameRange from Insert > Define > Name

That is fro say from a1:a5

Now I want to copy all a1:a5 in cell B1.

Can any one halp me?

Thanks in advance
--
Dhimant
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      15th Nov 2008
Are you saying that if a1:a5 has a,b,c,d then you want cell b1 to say
a,b,c,d in one cell? Spaces?, Be SPECIFIC.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Dhimant" <(E-Mail Removed)> wrote in message
news:E91BF00B-335B-440E-8417-(E-Mail Removed)...
> Hi,
>
> I had create a NameRange from Insert > Define > Name
>
> That is fro say from a1:a5
>
> Now I want to copy all a1:a5 in cell B1.
>
> Can any one halp me?
>
> Thanks in advance
> --
> Dhimant


 
Reply With Quote
 
Dhimant
Guest
Posts: n/a
 
      16th Nov 2008
yes it should be like a,b,c,d
--
India


"Don Guillett" wrote:

> Are you saying that if a1:a5 has a,b,c,d then you want cell b1 to say
> a,b,c,d in one cell? Spaces?, Be SPECIFIC.
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "Dhimant" <(E-Mail Removed)> wrote in message
> news:E91BF00B-335B-440E-8417-(E-Mail Removed)...
> > Hi,
> >
> > I had create a NameRange from Insert > Define > Name
> >
> > That is fro say from a1:a5
> >
> > Now I want to copy all a1:a5 in cell B1.
> >
> > Can any one halp me?
> >
> > Thanks in advance
> > --
> > Dhimant

>
>

 
Reply With Quote
 
keiji kounoike
Guest
Posts: n/a
 
      16th Nov 2008
If your data reside in only one column and the name of the range is fro,
try this one. but this one doesn't work if your data reside in multiple
columns.

Sub test()
Dim arr
arr = Application.Transpose(Range("fro"))
Range("fro").Offset(0, 1).Resize(1, 1) = join(arr, ",")
End Sub

keiji

Dhimant wrote:
> Hi,
>
> I had create a NameRange from Insert > Define > Name
>
> That is fro say from a1:a5
>
> Now I want to copy all a1:a5 in cell B1.
>
> Can any one halp me?
>
> Thanks in advance

 
Reply With Quote
 
Dhimant
Guest
Posts: n/a
 
      16th Nov 2008
Dear Keiji,

its working....But will it possible to convert it into functin?
i mean if i write =abc(arr) and the reasult will be a,b,c,d,e
--
Dhimant


"keiji kounoike" <"kounoike AT mbh.nifty." wrote:

> If your data reside in only one column and the name of the range is fro,
> try this one. but this one doesn't work if your data reside in multiple
> columns.
>
> Sub test()
> Dim arr
> arr = Application.Transpose(Range("fro"))
> Range("fro").Offset(0, 1).Resize(1, 1) = join(arr, ",")
> End Sub
>
> keiji
>
> Dhimant wrote:
> > Hi,
> >
> > I had create a NameRange from Insert > Define > Name
> >
> > That is fro say from a1:a5
> >
> > Now I want to copy all a1:a5 in cell B1.
> >
> > Can any one halp me?
> >
> > Thanks in advance

>

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      16th Nov 2008
Function ConCatRange(CellBlock As Range) As String
Dim Cell As Range
Dim sbuf As String
For Each Cell In CellBlock
If Len(Cell.text) > 0 Then sbuf = sbuf & Cell.text & ","
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

=concatrange(fro)

Or just =concatrange(a1:a5)


Gord Dibben MS Excel MVP

On Sun, 16 Nov 2008 03:26:04 -0800, Dhimant
<(E-Mail Removed)> wrote:

>Dear Keiji,
>
>its working....But will it possible to convert it into functin?
>i mean if i write =abc(arr) and the reasult will be a,b,c,d,e


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy column range of "single word" cells with spaces to a single c =?Utf-8?B?bmFzdGVjaA==?= Microsoft Excel Misc 3 15th Feb 2006 05:04 PM
How to I copy text from a range of cells to another single cell? =?Utf-8?B?V1JU?= Microsoft Excel Misc 2 18th Dec 2005 06:17 AM
Copy a single cell to a cell in a range Carrfamily Microsoft Excel Programming 1 10th Jul 2005 11:09 PM
Copy pasting a range in to a single column Hari Prasadh Microsoft Excel Programming 8 30th Jan 2005 05:34 PM
Range.Find returns cell outside of range when range set to single cell Frank Jones Microsoft Excel Programming 12 10th Jun 2004 04:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:26 AM.