populating empty cell with value from above

gixxer

New Member
Joined
Nov 23, 2005
Messages
3
Hi

I would very much appreciate any help/advice regarding the following.. The worksheet shows 4 columns date/customer/address/product. Where a customer orders more than one product the first 3 columns are not populated with relevant info..I need all cells populated so that date/customer/address are all complete in each row.

Any help guidance would be really apprecaitive.(I am using Excel 2003 and Windows XP PRo)

TIA
Rob
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
added sheet

sorry forgot to add the HTML copy of the sheet
New Microsoft Excel Worksheet.xls
ABCD
1DateCustomerAddressProduct
201/10/2005Joe Bloggs1 High stProduct 1
3Product 2
4Product 3
510/10/2005Ian Smith10 Supper ClProduct 1
6Product 2
710/10/2005William Brown101 Tech SqProduct 1
810/10/2005Eddy Green2a Lower AvProduct 1
921/10/2005Joe Bloggs1 High stProduct 3
10Product 5
Sheet1
 
Upvote 0
Try this code, which will populate the blank cells in columns A, B, and C for every row that has an entry in column D.
Code:
Sub MyCopy()

    Dim i As Long, j As Long
    For i = 2 To Range("D65536").End(xlUp).Row
        For j = 1 To 3
            If Cells(i, j) = "" Then Cells(i, j) = Cells(i - 1, j)
        Next j
    Next i
    
End Sub
 
Upvote 0
fantastic your code works

just a quick msg to say thankyou very much your code works brilliantly.

Many thanks

Rob
 
Upvote 0
No problem. And welcome to the Board!
 
Upvote 0

Forum statistics

Threads
1,207,011
Messages
6,076,145
Members
446,187
Latest member
LMill

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