#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 80
Default Repeat data

How do I repeat the stuff in column A when there's stuff in Col B?

My spreadsheet looks like this:

A B
000771605-0 1976 0000000


000771607-2 1976 0000000
0284831


000800014-5 2009 0000000
0681378
0681864
0682617


000804444-2 1981 0000000
0284831


000804444-2 1983 0000000
0284831


000804448-6 1980 0000000


000804448-6 1982 0000000
0681804


000812407-4 2006 0000000
0681865
0682683
0682694
0682695
0682697
0684836


000812415-1 2003 0000000
0681865
0682683
0682694
0682695
0682697
0684836


======================================


Here's what I need:


A B
000771605-0 1976 0000000


000771607-2 1976 0000000
000771607-2 1976 0284831


000800014-5 2009 0000000
000800014-5 2009 0681378
000800014-5 2009 0681864
000800014-5 2009 0682617


000804444-2 1981 0000000
000804444-2 1981 0284831


000804444-2 1983 0000000
000804444-2 1983 0284831


000804448-6 1980 0000000


000804448-6 1982 0000000
000804448-6 1982 0681804


000812407-4 2006 0000000
000812407-4 2006 0681865
000812407-4 2006 0682683
000812407-4 2006 0682694
000812407-4 2006 0682695
000812407-4 2006 0682697
000812407-4 2006 0684836


000812415-1 2003 0000000
000812415-1 2003 0681865
000812415-1 2003 0682683
000812415-1 2003 0682694
000812415-1 2003 0682695
000812415-1 2003 0682697
000812415-1 2003 0684836


Thank you in advance,

GaryWC
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default Repeat data

Gary,
This assumes the data starts in row1:

Sub FillBlanks()
Dim v As Variant, i As Long
v = Range("A1:B" & ActiveSheet.UsedRange.Rows.Count)
For i = 2 To UBound(v)
If v(i, 1) = "" Then
If v(i, 2) < "" Then v(i, 1) = v(i - 1, 1)
End If
Next 'i
Range("A1:B" & ActiveSheet.UsedRange.Rows.Count) = v
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


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
Repeat row data RussG Excel Discussion (Misc queries) 4 January 27th 09 12:07 AM
Repeat data Sdbenn90 Excel Discussion (Misc queries) 6 December 24th 05 12:11 PM
To repeat data row after row. Junior728 Excel Programming 2 September 19th 05 10:37 AM
Title Cut Off if Rows to Repeat & Columns to Repeat are Both Selec unibaby Excel Discussion (Misc queries) 2 August 24th 05 04:29 PM
Repeat Data Nagar Excel Programming 1 April 15th 05 02:57 AM


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