View Single Post
  #3   Report Post  
wickedchew wickedchew is offline
Senior Member
 
Location: Philippines
Posts: 161
Default

Quote:
Originally Posted by randhawa_125 View Post
First of all let me tell you all that i am totally new to Excel. I never used it before.. I am in a little trouble, so i need help of your guyz... Hope you guyz will help me.

My Problem is :

I have two columns "Sr.No" and "Previous Posting" as showing in the image 1 (Current Situation). Sr.No columns contains numbers in series and "Previous posting" contains all the posting details in the same column but in different rows..

Now i want to save all these posting details in a new sheet but not in a single column. Every posting detail should be in a new row with same Serial Number which belongs to that column, rather than all the posting record in a single column.

Results should be like as showing in image 2:

I hope you will understand my question and suggest me how to do this as i am totally new.
Right click on the name of the worksheet then select view code and paste this:

Sub DuplicateValuesInColumnA()

Dim a, b As Long

Columns("A").Select
Selection.UnMerge
a = Range("M" & Rows.Count).End(xlUp).Row - 2
For b = 0 To a
If Range("A2").Offset(b, 0) < "" Then
Range("A2").Offset(b, 0) = Range("A2").Offset(b, 0)
Else: Range("A2").Offset(b, 0) = Range("A2").Offset(b - 1, 0)
End If
Next b

End Sub
__________________
Asobi Wa Owari Da