fill in empty cells from column a using VB

lefty38

Board Regular
Joined
Oct 27, 2005
Messages
85
i am looking for a vb code that will fill in the blank cells

column A has all of the data -
column B has some of the data
Column C has some of the data

looking to fill in Column b and c from values from the a column
example Red colored values would be the "VB" created values


<table style="width: 403px; height: 367px;" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" width="64" span="3"> <col style="width: 41pt;" width="55"> <col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 14.4pt;" height="19"> <td class="xl68" style="height: 14.4pt; width: 48pt;" width="64" height="19">a

</td> <td class="xl68" style="width: 48pt;" width="64">b</td> <td class="xl68" style="width: 48pt;" width="64">c</td> <td class="xl65" style="width: 41pt;" width="55">
</td> <td class="xl67" style="width: 48pt;" width="64">a</td> <td class="xl67" style="width: 48pt;" width="64">b</td> <td class="xl67" style="width: 48pt;" width="64">c</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">1st</td> <td class="xl65">2nd</td> <td class="xl65">3rd</td> <td class="xl65">
</td> <td class="xl65">1st</td> <td class="xl65">2nd</td> <td class="xl65">3rd</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">737</td> <td class="xl65">737</td> <td class="xl65">737</td> <td class="xl65">
</td> <td class="xl65">737</td> <td class="xl65">737</td> <td class="xl65">737</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">738</td> <td class="xl66">
</td> <td class="xl66">
</td> <td class="xl65">
</td> <td class="xl65">738</td> <td class="xl66">738</td> <td class="xl66">738</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">738</td> <td class="xl65">738</td> <td class="xl65">738</td> <td class="xl65">
</td> <td class="xl65">738</td> <td class="xl65">738</td> <td class="xl65">738</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">74</td> <td class="xl66">
</td> <td class="xl66">
</td> <td class="xl65">
</td> <td class="xl65">74</td> <td class="xl66">74</td> <td class="xl66">74</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">74</td> <td class="xl66">
</td> <td class="xl66">
</td> <td class="xl65">
</td> <td class="xl65">74</td> <td class="xl66">74</td> <td class="xl66">74</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">742</td> <td class="xl65">742</td> <td class="xl65">742</td> <td class="xl65">
</td> <td class="xl65">742</td> <td class="xl65">742</td> <td class="xl65">742</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">742</td> <td class="xl66">
</td> <td class="xl66">
</td> <td class="xl65">
</td> <td class="xl65">742</td> <td class="xl66">742</td> <td class="xl66">742</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">744</td> <td class="xl65">744</td> <td class="xl65">744</td> <td class="xl65">
</td> <td class="xl65">744</td> <td class="xl65">744</td> <td class="xl65">744</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">744</td> <td class="xl65">744</td> <td class="xl65">744</td> <td class="xl65">
</td> <td class="xl65">744</td> <td class="xl65">744</td> <td class="xl65">744</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">746</td> <td class="xl66">
</td> <td class="xl66">
</td> <td class="xl65">
</td> <td class="xl65">746</td> <td class="xl66">746</td> <td class="xl66">746</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">746</td> <td class="xl65">746</td> <td class="xl65">746</td> <td class="xl65">
</td> <td class="xl65">746</td> <td class="xl65">746</td> <td class="xl65">746</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">748</td> <td class="xl65">748</td> <td class="xl65">748</td> <td class="xl65">
</td> <td class="xl65">748</td> <td class="xl65">748</td> <td class="xl65">748</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">748</td> <td class="xl65">748</td> <td class="xl66">
</td> <td class="xl65">
</td> <td class="xl65">748</td> <td class="xl65">748</td> <td class="xl66">748</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">748</td> <td class="xl65">748</td> <td class="xl65">748</td> <td class="xl65">
</td> <td class="xl65">748</td> <td class="xl65">748</td> <td class="xl65">748</td> </tr> <tr style="height: 14.4pt;" height="19"> <td class="xl65" style="height: 14.4pt;" height="19">
</td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> </tr> </tbody></table>
 
mirabeau, Gosh I hope that its not to late to ask on the March 29th


How do you start the code at A7:C7?

Code:
Sub fillright() Dim n&, a, i&, j& n = Cells(Rows.Count, 1)
.End(3).Row a = Range("A1:C" & n)
 For i = 1 To n If Len(a(i, 1)) > 0 Then For j = 1 To 3 
If Len(a(i, j)) = 0 Then a(i, j) = a(i, j - 1) Next j 
End If Next i Range("A1:C" & n) = a End Sub
thank you
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
hi lefty38,

Seems I forgot all about that one.

to start at row 7, try the following modified version (I think the 3 changes are all that's needed)
Rich (BB code):
Sub fill_titles2()
Dim n&, a, i&, j&
n = Cells(Rows.Count, 1).End(3).Row
a = Range("A7:C" & n)
For i = 1 To n - 6
If Len(a(i, 1)) > 0 Then
   For j = 1 To 3
       If Len(a(i, j)) = 0 Then a(i, j) = a(i, j - 1)
   Next j
End If
Next i
Range("A7:C" & n) = a
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,282
Members
452,902
Latest member
Knuddeluff

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