Fill in the blanks...

omnivl

Board Regular
Joined
Aug 25, 2014
Messages
53
How in VBA can i fill in the blank rows and fill them...it needs to find the name after the blank and copy both fields to the above cells. Appreciate any help :)

So from this.....

[TABLE="class: grid, width: 144"]
<tbody>[TR]
[TD]V00006
[/TD]
[TD]Action Office Machines P/L[/TD]
[/TR]
[TR]
[TD]V03393[/TD]
[TD]Active Sound Services
[/TD]
[/TR]
[TR]
[TD]V03271[/TD]
[TD]Adaptalift Group Pty Ltd
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]V02472[/TD]
[TD]Adventure Junkie - AJ Events Pty Ltd[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]V00595[/TD]
[TD]Air Liquide Australia Limited[/TD]
[/TR]
[TR]
[TD]V01683[/TD]
[TD]Ali Baxter - Soulstice[/TD]
[/TR]
[TR]
[TD]V03243
[/TD]
[TD]Alison Green Designs[/TD]
[/TR]
[TR]
[TD]V02972[/TD]
[TD]A-List Entertainment
[/TD]
[/TR]
</tbody>[/TABLE]


to this....

[TABLE="class: grid, width: 144"]
<tbody>[TR]
[TD]V00006[/TD]
[TD]Action Office Machines P/L[/TD]
[/TR]
[TR]
[TD]V03393[/TD]
[TD]Active Sound Services[/TD]
[/TR]
[TR]
[TD]V03271[/TD]
[TD]Adaptalift Group Pty Ltd[/TD]
[/TR]
[TR]
[TD]V02472[/TD]
[TD]Adventure Junkie - AJ Events Pty Ltd[/TD]
[/TR]
[TR]
[TD]V02472[/TD]
[TD]Adventure Junkie - AJ Events Pty Ltd[/TD]
[/TR]
[TR]
[TD]V00595[/TD]
[TD]Air Liquide Australia Limited[/TD]
[/TR]
[TR]
[TD]V00595[/TD]
[TD]Air Liquide Australia Limited[/TD]
[/TR]
[TR]
[TD]V00595[/TD]
[TD]Air Liquide Australia Limited[/TD]
[/TR]
[TR]
[TD]V00595[/TD]
[TD]Air Liquide Australia Limited[/TD]
[/TR]
[TR]
[TD]V00595[/TD]
[TD]Air Liquide Australia Limited[/TD]
[/TR]
[TR]
[TD]V01683[/TD]
[TD]Ali Baxter - Soulstice[/TD]
[/TR]
[TR]
[TD]V03243[/TD]
[TD]Alison Green Designs[/TD]
[/TR]
[TR]
[TD]V02972[/TD]
[TD]A-List Entertainment[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Give this macro a try...
Code:
Sub FillBlanksFromBelow()
  Dim LastRow As Long
  LastRow = Cells(Rows.Count, "B").End(xlUp).Row
  With Range("A1:B" & LastRow)
    .SpecialCells(xlBlanks).FormulaR1C1 = "=R[1]C"
    .Value = .Value
  End With
End Sub
 
Upvote 0
Give this macro a try...
Code:
Sub FillBlanksFromBelow()
  Dim LastRow As Long
  LastRow = Cells(Rows.Count, "B").End(xlUp).Row
  With Range("A1:B" & LastRow)
    .SpecialCells(xlBlanks).FormulaR1C1 = "=R[1]C"
    .Value = .Value
  End With
End Sub

You sir are a Genius!
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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