Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread Mukesh Kumar
Thanks very very much Sam Mathai Chacko sir. This was the resultant code i was looking for. You are marvellous in excel sir. Thanks again. Regards, Mukesh Kumar On Wed, Feb 1, 2012 at 12:01 AM, Sam Mathai Chacko wrote: > The code I gave was exactly for assigning any number of header groups. > >

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread Mukesh Kumar
Thanks a lot for solving my queries Ansari ji. But still one problem knocking my mind that these macroes are suitable for respective problems i have given i.e for two similar headers separate code & for three similar headers another coding is required & so on. Can u give common macro irrespective

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread Kris
One of the header is 'No' instead of 'No.' Correct the headers, it should work Kris -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread Sam Mathai Chacko
Here's the working model. Have given a button for ease. Sam Mathai Chacko On Tue, Jan 31, 2012 at 10:21 PM, Sam Mathai Chacko wrote: > Sub Consolidator() > > Dim rngSource As Range > Dim lngCols As Long, lngRows As Long > Set rngSource = Range("A1").CurrentRegion > lngRows = rngS

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread Sam Mathai Chacko
Sub Consolidator() Dim rngSource As Range Dim lngCols As Long, lngRows As Long Set rngSource = Range("A1").CurrentRegion lngRows = rngSource.CurrentRegion.Rows.Count - 1 For lngCols = 3 To rngSource.Columns.Count - 1 Step 2 rngSource.Cells(2, lngCols).Resize(lngRows, 2

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread Mukesh Kumar
Dear Kris, Following error is coming after macro execution Run time error '9': Subscript out of range. Please correct it. Regards, Mukesh kumar On Tue, Jan 31, 2012 at 10:00 PM, Kris wrote: > > Sub kTest() > > Dim x, ka, k(), i As Long, n As Long, c As Long, j As Long, p As Long > >

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread Kris
Sub kTest() Dim x, ka, k(), i As Long, n As Long, c As Long, j As Long, p As Long With Worksheets("Query") ka = .Range("a1").CurrentRegion End With With CreateObject("scripting.dictionary") .comparemode = 1 For c = 1 To UBound(ka, 2)

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread dguillett1
Subject: Re: $$Excel-Macros$$ Query continuous copy paste @ Don Guillett Dear sir, your macro after running giving wrong results, please check. @ Noorain Ansari Sir, macro after running showing error compile error. Sub or function not defined. Please note, i am having different workbooks in

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread Mukesh Kumar
@ Don Guillett Dear sir, your macro after running giving wrong results, please check. @ Noorain Ansari Sir, macro after running showing error compile error. Sub or function not defined. Please note, i am having different workbooks in which some workbooks contains 2 columns similar, some 3 columns

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread dguillett1
Try Option Explicit Sub copycolumstorowsSAS() Dim i As Long For i = 1 To Cells(1, Columns.Count).End(xlToLeft).Column Step 2 Cells(2, i).Resize(6, 2).Copy Cells(Rows.Count, 1).End(xlUp).Offset(1) Next i End Sub Don Guillett SalesAid Software dguille...@gmail.com -Original Message- Fro

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread NOORAIN ANSARI
Dear Mukesh, Can you provide that worksheet, where macro is not running... Please share workbook with group.. On Tue, Jan 31, 2012 at 7:17 PM, Mukesh Kumar wrote: > Thanks Noorain Ansari Ji for the solution but it works is working with > this sheet only i.e if the column headings are having two

Re: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread Mukesh Kumar
Thanks Noorain Ansari Ji for the solution but it works is working with this sheet only i.e if the column headings are having two same titles. If I have to transform three or four columns to first three or four columns then this macro will not work there. Please suggest any formula or user form acco

RE: $$Excel-Macros$$ Query continuous copy paste

2012-01-31 Thread Rajan_Verma
Try this : Sub Transformdata() Dim rngCEll As Range Dim rngRange As Range Dim wksOutput As Worksheet Set wksOutput = ThisWorkbook.Worksheets.Add Set rngRange = ThisWorkbook.Worksheets("Query").Rows(1) For Each rngCEll In rngRange.Cells Application.ScreenUpdating