• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copy a particular cell value down to the next available non-blank cell

jayexcel1

Member
Hi,

Attached is the sample data and my requirement of how I want the data to get populated.

Data has 3 columns: Product/Date Time/Sales
Product column has single entry for type of Product and multiple entries for date time and sales column. My requirement is to have the type of product against all date time and sales column.

jay.
 

Attachments

  • test data 2.xlsx
    9 KB · Views: 0
@ jayexcel1

Pls check this..

Code:
Sub test_fill()
Range("A2").Select
Do While Selection <> "Grand Total"
    Range(Selection, Selection.End(xlDown).Offset(-1)).FillDown
Selection.End(xlDown).Select
Loop
End Sub
 
Hi,

A small value addition is required in the code!!!
So, the revised code is...

Code:
Sub test_fill()

If Application.CountA(Columns(1)) - 1 = Application.CountA(Columns(2)) Then Exit Sub

Range("A2").Select
Do While Selection <> "Grand Total"
    Range(Selection, Selection.End(xlDown).Offset(-1)).FillDown
Selection.End(xlDown).Select
Loop
End Sub
 
Back
Top