View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gandei Gandei is offline
external usenet poster
 
Posts: 5
Default Fill down relating to cell value

Try this macro.
Sub FillDown()

'Pre cond: Part number in column A and qty in column B.
' Single data can't exist in cells of col A and B
i.e. Data present in both An and Bn or nothing present in
both
'Post cond: Results put in col D

Dim i, j, k As Integer

i = 0
j = 0
Do While Range("B1").Offset(i, 0) < vbNullString
For k = 1 To Val(Range("B1").Offset(i, 0))
Range("D1").Offset(j, 0).Value = Range
("A1").Offset(i, 0).Value
j = j + 1
Next k
i = i + 1
Loop

End Sub

-----Original Message-----
Good afternoon all!

I have a problem which i'm sure some of you will find

easy in Excel!
I have a large two column sheet with a part number and a

quantity. What
i need to do is repeat/fill down the part number refering

to the qty,
ie:

123456 x 2
234567 x 3

would be

123456
123456
234567
234567
234567

Please help - the limitations of my labelling software

are really
getting to me!


---
Message posted from http://www.ExcelForum.com/

.