Fill Data - Row Based

Blessy Clara

Board Regular
Joined
Mar 28, 2010
Messages
201
Hi I have an excel sheet with two columns
[TABLE="width: 500"]
<tbody>[TR]
[TD]ABC Org[/TD]
[TD]Assist Prod-Pers Care/Safety[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Disability Safety[/TD]
[/TR]
[TR]
[TD]Whole Family Health[/TD]
[TD]Interpret/Translate[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Assist Prod-Pers Care/Safety[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Personal Mobility Equipment[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Early Childhood Supports[/TD]
[/TR]
[TR]
[TD][TABLE="width: 302"]
<tbody>[TR]
[TD="width: 302"]Visability Ltd[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Service1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Service2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Actually the Blank Rows in Org Column Must be filled as this - Coz the Services are given as separate Row, it actually belongs to the Org occurring first and the next org and its services ..and so on

[TABLE="width: 500"]
<tbody>[TR]
[TD]ABC Org[/TD]
[TD]Assist Prod-Pers Care/Safety[/TD]
[/TR]
[TR]
[TD]ABC Org[/TD]
[TD]Disability Safety[/TD]
[/TR]
[TR]
[TD]Whole Family Health[/TD]
[TD]Interpret/Translate[/TD]
[/TR]
[TR]
[TD]Whole Family Health[/TD]
[TD]Assist Prod-Pers Care/Safety[/TD]
[/TR]
[TR]
[TD]Whole Family Health[/TD]
[TD]Personal Mobility Equipment[/TD]
[/TR]
[TR]
[TD]Whole Family Health[/TD]
[TD]Early Childhood Supports[/TD]
[/TR]
[TR]
[TD]Visability Ltd[/TD]
[TD]Service1[/TD]
[/TR]
[TR]
[TD]Visability Ltd[/TD]
[TD]Service2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Thank you
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
using Power Query aka Get&Transform

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]ORG[/td][td=bgcolor:#5B9BD5]Services[/td][td][/td][td=bgcolor:#70AD47]ORG[/td][td=bgcolor:#70AD47]Services[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]ABC Org[/td][td=bgcolor:#DDEBF7]Assist Prod-Pers Care/Safety[/td][td][/td][td=bgcolor:#E2EFDA]ABC Org[/td][td=bgcolor:#E2EFDA]Assist Prod-Pers Care/Safety[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td]Disability Safety[/td][td][/td][td]ABC Org[/td][td]Disability Safety[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Whole Family Health[/td][td=bgcolor:#DDEBF7]Interpret/Translate[/td][td][/td][td=bgcolor:#E2EFDA]Whole Family Health[/td][td=bgcolor:#E2EFDA]Interpret/Translate[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td]Assist Prod-Pers Care/Safety[/td][td][/td][td]Whole Family Health[/td][td]Assist Prod-Pers Care/Safety[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]Personal Mobility Equipment[/td][td][/td][td=bgcolor:#E2EFDA]Whole Family Health[/td][td=bgcolor:#E2EFDA]Personal Mobility Equipment[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td]Early Childhood Supports[/td][td][/td][td]Whole Family Health[/td][td]Early Childhood Supports[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Visability Ltd[/td][td=bgcolor:#DDEBF7]Service1[/td][td][/td][td=bgcolor:#E2EFDA]Visability Ltd[/td][td=bgcolor:#E2EFDA]Service1[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td]Service2[/td][td][/td][td]Visability Ltd[/td][td]Service2[/td][/tr]
[/table]


Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    FilledDown = Table.FillDown(Source,{"ORG"})
in
    FilledDown[/SIZE]
 
Upvote 0
no, this is M-code not vba

Data tab - New Query - From Other Sources - Blank Query
it will open Power Query Editor
Advanced Editor - replace code there with code copied from the post then OK, Close&Load


be sure the name in the code is the same as your source table name (here: Table1)
 
Upvote 0
Hi
What about
Code:
Sub test()
    Dim a As Variant
        a = Cells(1, 1).Resize(Cells(Rows.Count, 2).End(xlUp).Row, 2)
    For i = 2 To UBound(a)
    If a(i, 1) = "" Then a(i, 1) = a(i - 1, 1)
     Next
     Cells(1, 1).Offset(1, 5).Resize(UBound(a), 2) = a
End Sub
 
Upvote 0
How about
Code:
Sub Blessy()
    With Range("A2:A", Range("B" & Rows.Count).End(xlUp).Row)
        .SpecialCells(xlBlanks).FormulaR1C1 = "r[-1]c"
        .Value = .Value
    End With
End Sub
 
Upvote 0
Hi Sandy66 Thank you - but i am unable to get Blank Query as mentioned (post following the steps) . However thanks for your time and response
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top