Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Converting an Array to value's

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Converting an Array to value's

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Converting an Array to value's

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Converting an Array to value's

Hi,

Try this mod

The correct syntax for calling the function is

=listvalues(A1,Sheet1!B1:B4)

Function listvalues(key As Long, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function

"Gunti" wrote:

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Converting an Array to value's

Gunti,

That's my correct regional syntax it looks like your using ; instead of , so
change it.

Mike

"Gunti" wrote:

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Converting an Array to value's

Hi mike,
This time i'm getting a #value error. I tried embracing both references in
the Value function.. Also didn't work.

Thanks again for the help, though.

Greets,
Gunti

"Mike H" wrote:

Gunti,

That's my correct regional syntax it looks like your using ; instead of , so
change it.

Mike

"Gunti" wrote:

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Converting an Array to value's

Hi,

A value error is when it cannot find a match for what is in A1 on Sheet1.
Check your numbers really are numbers not text that looks like numbers

To demonstrate the point type a number in a1 (A 1 will do). Ensuring a cell
in Column A of sheet 1 is formatted as general type the same number in there
and my bet is the value error will go away.


Mike

"Gunti" wrote:

Hi mike,
This time i'm getting a #value error. I tried embracing both references in
the Value function.. Also didn't work.

Thanks again for the help, though.

Greets,
Gunti

"Mike H" wrote:

Gunti,

That's my correct regional syntax it looks like your using ; instead of , so
change it.

Mike

"Gunti" wrote:

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Converting an Array to value's

Even if i type everything, the way you're telling me, into excel i keep
getting the #value# error. I've had this problem an amazing amount of times.

I'm getting kinda desperate, can i change the offset in the VB to +1 (or 1)
by the way?

I'll keep on trying.

Gunti

"Mike H" wrote:

Hi,

A value error is when it cannot find a match for what is in A1 on Sheet1.
Check your numbers really are numbers not text that looks like numbers

To demonstrate the point type a number in a1 (A 1 will do). Ensuring a cell
in Column A of sheet 1 is formatted as general type the same number in there
and my bet is the value error will go away.


Mike

"Gunti" wrote:

Hi mike,
This time i'm getting a #value error. I tried embracing both references in
the Value function.. Also didn't work.

Thanks again for the help, though.

Greets,
Gunti

"Mike H" wrote:

Gunti,

That's my correct regional syntax it looks like your using ; instead of , so
change it.

Mike

"Gunti" wrote:

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Converting an Array to value's

Hi,

Upload a sample of your workbook here and post the link.
http://savefile.com/

You can change the offset to whatever you want providing it references a
cell for example -1 offsets 1 column to the left whuch is fine for column B
but if you apply a -1 offset to column A then you have a problem.

Mike

"Gunti" wrote:

Even if i type everything, the way you're telling me, into excel i keep
getting the #value# error. I've had this problem an amazing amount of times.

I'm getting kinda desperate, can i change the offset in the VB to +1 (or 1)
by the way?

I'll keep on trying.

Gunti

"Mike H" wrote:

Hi,

A value error is when it cannot find a match for what is in A1 on Sheet1.
Check your numbers really are numbers not text that looks like numbers

To demonstrate the point type a number in a1 (A 1 will do). Ensuring a cell
in Column A of sheet 1 is formatted as general type the same number in there
and my bet is the value error will go away.


Mike

"Gunti" wrote:

Hi mike,
This time i'm getting a #value error. I tried embracing both references in
the Value function.. Also didn't work.

Thanks again for the help, though.

Greets,
Gunti

"Mike H" wrote:

Gunti,

That's my correct regional syntax it looks like your using ; instead of , so
change it.

Mike

"Gunti" wrote:

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Converting an Array to value's

Hi Mike,
I think i'm getting somewhere, i'm testing something out. And what happens
is this.

I have approx. 3000 rows to apply this to. I'm noticing the #Value# error if
i put more than 136 rows in the array. If i reduce the amount of rows i get
exactly what i want. Any idea's?

Greets

"Mike H" wrote:

Hi,

A value error is when it cannot find a match for what is in A1 on Sheet1.
Check your numbers really are numbers not text that looks like numbers

To demonstrate the point type a number in a1 (A 1 will do). Ensuring a cell
in Column A of sheet 1 is formatted as general type the same number in there
and my bet is the value error will go away.


Mike

"Gunti" wrote:

Hi mike,
This time i'm getting a #value error. I tried embracing both references in
the Value function.. Also didn't work.

Thanks again for the help, though.

Greets,
Gunti

"Mike H" wrote:

Gunti,

That's my correct regional syntax it looks like your using ; instead of , so
change it.

Mike

"Gunti" wrote:

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Converting an Array to value's

Is mailing an option? You can send me an e-mail at
mathijs(dot)versteeg(at)hotmail-dot-com

I'll reply with a file.

Greets

"Gunti" wrote:

Hi Mike,
I think i'm getting somewhere, i'm testing something out. And what happens
is this.

I have approx. 3000 rows to apply this to. I'm noticing the #Value# error if
i put more than 136 rows in the array. If i reduce the amount of rows i get
exactly what i want. Any idea's?

Greets

"Mike H" wrote:

Hi,

A value error is when it cannot find a match for what is in A1 on Sheet1.
Check your numbers really are numbers not text that looks like numbers

To demonstrate the point type a number in a1 (A 1 will do). Ensuring a cell
in Column A of sheet 1 is formatted as general type the same number in there
and my bet is the value error will go away.


Mike

"Gunti" wrote:

Hi mike,
This time i'm getting a #value error. I tried embracing both references in
the Value function.. Also didn't work.

Thanks again for the help, though.

Greets,
Gunti

"Mike H" wrote:

Gunti,

That's my correct regional syntax it looks like your using ; instead of , so
change it.

Mike

"Gunti" wrote:

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Converting an Array to value's

see my other post, upload to savefile

"Gunti" wrote:

Is mailing an option? You can send me an e-mail at
mathijs(dot)versteeg(at)hotmail-dot-com

I'll reply with a file.

Greets

"Gunti" wrote:

Hi Mike,
I think i'm getting somewhere, i'm testing something out. And what happens
is this.

I have approx. 3000 rows to apply this to. I'm noticing the #Value# error if
i put more than 136 rows in the array. If i reduce the amount of rows i get
exactly what i want. Any idea's?

Greets

"Mike H" wrote:

Hi,

A value error is when it cannot find a match for what is in A1 on Sheet1.
Check your numbers really are numbers not text that looks like numbers

To demonstrate the point type a number in a1 (A 1 will do). Ensuring a cell
in Column A of sheet 1 is formatted as general type the same number in there
and my bet is the value error will go away.


Mike

"Gunti" wrote:

Hi mike,
This time i'm getting a #value error. I tried embracing both references in
the Value function.. Also didn't work.

Thanks again for the help, though.

Greets,
Gunti

"Mike H" wrote:

Gunti,

That's my correct regional syntax it looks like your using ; instead of , so
change it.

Mike

"Gunti" wrote:

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Converting an Array to value's

My problem is i'm currently at work and it's blocked here.



"Mike H" wrote:

see my other post, upload to savefile

"Gunti" wrote:

Is mailing an option? You can send me an e-mail at
mathijs(dot)versteeg(at)hotmail-dot-com

I'll reply with a file.

Greets

"Gunti" wrote:

Hi Mike,
I think i'm getting somewhere, i'm testing something out. And what happens
is this.

I have approx. 3000 rows to apply this to. I'm noticing the #Value# error if
i put more than 136 rows in the array. If i reduce the amount of rows i get
exactly what i want. Any idea's?

Greets

"Mike H" wrote:

Hi,

A value error is when it cannot find a match for what is in A1 on Sheet1.
Check your numbers really are numbers not text that looks like numbers

To demonstrate the point type a number in a1 (A 1 will do). Ensuring a cell
in Column A of sheet 1 is formatted as general type the same number in there
and my bet is the value error will go away.


Mike

"Gunti" wrote:

Hi mike,
This time i'm getting a #value error. I tried embracing both references in
the Value function.. Also didn't work.

Thanks again for the help, though.

Greets,
Gunti

"Mike H" wrote:

Gunti,

That's my correct regional syntax it looks like your using ; instead of , so
change it.

Mike

"Gunti" wrote:

Mike, this is exactly what i'm looking for. I'm having some trouble, however.

I'm getting a #num# error. I can't seem to find the problem.
A couple example value's i'm using:

Sheet1:

A B
900101967 460342173
900098554 460333597
900101967 460333596


Sheet2:

A
900101967

Listvalues(A1;'Sheet1'!B2:B4') returns #NUM

Any help? your help is greatly appreciated!





"Mike H" wrote:

Hi,

How about a UDF Alt+F11 to open Vb editor, right click 'This Workbook' and
insert module and paste the code in on the right.

Call with
=listvalues(1,B1:B5)

The 1 could be a range

=listvalues(A1,B1:B5)


Function listvalues(key As Integer, Rng As Range)
For Each c In Rng
If c.Offset(0, -1).Value = key Then
listvalues = listvalues & c.Value & " , "
End If
Next
listvalues = Left(listvalues, Len(listvalues) - 3)
End Function


Mike


"Gunti" wrote:

Hello,
I'll first give an example of my situation.

I've got a couple of value's:

A B
1 55
1 56
2 58
3 59
1 60

I'm looking for a method so i can make a list like this:
A B
1: 55,56,60

Basicly Excel has to put the value's in the following cell divided by a ,

I've come as far as making an IF function like IF(A1:A3="1";B1:B3;"Error")
Now the list of numbers (55,56,60) is in an array.

Is there any way to convert this array to the format i described?


Greetings,
Gunti

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
combo box and value's Trey Excel Discussion (Misc queries) 0 July 11th 07 08:36 PM
Converting column to array asaylor Excel Worksheet Functions 0 August 7th 06 08:02 PM
delete zero value's using a macro tweacle Excel Worksheet Functions 1 January 22nd 06 11:31 PM
Sum amount if = 2 value's loscherland Excel Discussion (Misc queries) 1 July 4th 05 03:03 PM
Multiple lookup value's rucker31 Excel Worksheet Functions 0 March 11th 05 11:17 PM


All times are GMT +1. The time now is 05:20 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"