Hi Alpesh, May be if this can help you.
Sub TransposeData() Dim rngdata As Range With ThisWorkbook.Worksheets("Sheet3") Set rngdata = .Range("A1").CurrentRegion rngdata.Copy ThisWorkbook.Worksheets("sheet4").Range("A1").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True Application.CutCopyMode = False End With End Sub Note: 1 :Change The Sheet3 as per the sheet name on which you have the data. 2:Change The Sheet4 as per the sheet name where you want to paste the data. 3: Here i m considering Data strat from range A1 so you also needs to change this from the cell where your data starts. Regards Prince On Thursday, January 31, 2013 3:12:28 AM UTC+5:30, pesh wrote: > > Dear Excel Masters, > > I have raw data that is in the following form: > > 1 name abc > 2 address 234 john lane > 3 company inc, co > 4 website http://website.com > 5 description company abc is abc > > What I would like to do is have this information look like this, where the > data is taken from rows and transposed into such columns: > > name| address | company| website |description > abc |243 john lane | inc, co | http://website.com | abc is abc > > The catch is that the pattern does not always go 1,2,3,4,5. Sometimes it > only goes 1,2,3 or 1,2,5. > > As there are 4000+ lines, I attempted to write a macro but if failed. I > was hoping that you may be able to help. > > I have attached a sample file. > > Thank you in advance. > Alpesh > -- Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en. For more options, visit https://groups.google.com/groups/opt_out.