Try this :

See the attached file.. Data should be in same format in RawData Sheet.

Revert if it not desired.

 

Sub TranformThis()

 

    Dim rng As Range

    Dim rngCell As Range

    Dim wksRawData  As Worksheet

    Dim wksOutput As Worksheet

    Dim rngTarget As Range

    Set wksOutput = ThisWorkbook.Worksheets("Output")

    Set wksRawData = ThisWorkbook.Worksheets("RawData")

 

    Application.ScreenUpdating = False

   ThisWorkbook.Worksheets.Add.Name = "Data"

    Set wksData = ThisWorkbook.Worksheets("Data")

    With wksRawData

    Set rngTarget = .Range("A" & .Range("A" &
wksRawData.Rows.Count).End(xlUp).Row)

    rngTarget.Resize(10, 20).Copy wksData.Range("A1")

    End With

Lp:

    With wksRawData

    Set rngTarget = rngTarget.End(xlUp).Cells

    rngTarget.Resize(10, 20).Copy wksData.Range("A1")

    End With

    Set rng = wksData.UsedRange

    rng.Cells.MergeCells = False

    For Each rngCell In rng.Columns

        If WorksheetFunction.CountA(rngCell) = 0 Then rngCell.Delete

    Next

    wksData.UsedRange.Cells.SpecialCells(xlCellTypeBlanks).Delete xlUp

    wksData.Range("o1").EntireColumn.Delete

    wksData.UsedRange.Rows.Copy wksOutput.Range("A" & wksOutput.Range("o" &
wksOutput.Rows.Count).End(xlUp).Row + 1)

    wksData.Cells.ClearContents

    If rngTarget.Row > 12 Then

        GoTo Lp:

    End If

    Application.DisplayAlerts = False

    wksData.Delete

    Application.DisplayAlerts = True

    Application.ScreenUpdating = True

    wksOutput.Activate

    

    Set rng = Nothing

    Set rngCell = Nothing

    Set wksRawData = Nothing

    Set wksOutput = Nothing

    Set rngTarget = Nothing

 

End Sub

 

 

From: Priya Jose [mailto:questpr...@gmail.com] 
Sent: Jan/Tue/2012 06:33
To: rajanverma1...@gmail.com
Subject: Fwd: $$Excel-Macros$$ Solution Required as per the Raw Data

 

Hi Rajan,

 

Good day to you...!
 

Please find attach and request you to provide me a solution. The file
contains 2 sheets namely Raw Data and Output required. Please provide me a
solution as per the Output sheet format from the Rawdata sheet.

 

Waiting in anticipation for your help.

 

Many thanks in advance...!

 

Regards

 

-- 
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 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)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to