Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to list numbers


I have a column of numbers say 1 to 10 in column A
In column B at various rows there could be a number. This is the number
of times I need the number in column A repeated in column C eg.
A B C
1 3
2 3
3 3 3
4 2 4
5 2 4
6 1 5
7 5
8 6
9 10
10 1
I have been trying to write a macro for this. I have got as far as
going down column A and identifying how many rows are populated and
then got stuck.
Help would be appreciated


--
tryer
------------------------------------------------------------------------
tryer's Profile: http://www.excelforum.com/member.php...o&userid=16546
View this thread: http://www.excelforum.com/showthread...hreadid=397591

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Macro to list numbers

This worked in xl2K -

Dim lrw As Long, x As Integer, cel As Range, rw As Long

lrw = Cells(Rows.Count, "A").End(xlUp).Row

For Each cel In Range("A1:A" & lrw)
If cel.Offset(0, 1) 0 Then
rw = WorksheetFunction.CountA(Columns(3)) + 1
For x = rw To rw + cel.Offset(0, 1) - 1
Cells(x, 3) = cel
Next
End If
Next


--
steveB

Remove "AYN" from email to respond
"tryer" wrote in
message ...

I have a column of numbers say 1 to 10 in column A
In column B at various rows there could be a number. This is the number
of times I need the number in column A repeated in column C eg.
A B C
1 3
2 3
3 3 3
4 2 4
5 2 4
6 1 5
7 5
8 6
9 10
10 1
I have been trying to write a macro for this. I have got as far as
going down column A and identifying how many rows are populated and
then got stuck.
Help would be appreciated


--
tryer
------------------------------------------------------------------------
tryer's Profile:
http://www.excelforum.com/member.php...o&userid=16546
View this thread: http://www.excelforum.com/showthread...hreadid=397591



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
How can I extract a list of numbers missing in a list? Nancy New Users to Excel 2 January 28th 10 11:18 PM
how can I add +ve numbers only in a list of +ve and -ve numbers Paul Excel Discussion (Misc queries) 1 December 10th 07 06:20 AM
change a vertical list of numbers to horizontal list from 1 cell caz Excel Discussion (Misc queries) 3 September 27th 06 12:11 PM
how to extract unique numbers once from a list of repeated numbers? [email protected] Excel Discussion (Misc queries) 2 May 2nd 06 04:17 PM
How to create a macro that compares a list to another list Rampa New Users to Excel 1 January 13th 05 01:15 PM


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