• 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.

VBA UNIQUE VALUES

helloakshay

New Member
Hi All

I have a sheet with some values in a column. example 5 diffrent number in column G

I want to copy those values and copy them between the empty rows between those numbers

1st number is 12345 and there are 10 rows empty after that in the same column i want to copy 12345 in the next 10 rows.
the next number 666666 after that there are only 5 rows empty and i want to copy the same in the next 5 rows and so on ..

Any idea how i need to start. guess it should be first to count the number of values in that particular column
 
Try this code
Code:
Sub Test()
    Dim Cell As Range
  
    On Error Resume Next
    For Each Cell In Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row).SpecialCells(xlCellTypeBlanks)
        Cell.Value = Cell.Offset(-1).Value
    Next Cell
End Sub
***
Thank you very much yaseer. Appreciate for your timely help.
 
Back
Top