+ Reply to Thread
Results 1 to 2 of 2

data formating

Hybrid View

pmugagga data formating 06-07-2013, 05:01 AM
ragulduy Re: data formating 06-07-2013, 05:07 AM
  1. #1
    Registered User
    Join Date
    06-07-2013
    Location
    uganda
    MS-Off Ver
    Excel 2010
    Posts
    6

    data formating

    I have columns A to H
    If column H for any row is greater than 0, i want data from column D till H for that row to be inserted below the row

    e.g.


    Sample data:
    A 1 2 3 A 1 2 0
    B 1 2 4 B 2 2 3
    C 1 2 3 C 2 2 6
    D 1 2 7 D 1 2 0

    desired output:
    A 1 2 3
    B 1 2 4
    B 1 2 3
    C 1 2 3
    C 2 2 6
    D 1 2 7

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: data formating

    Sub Data_Format_Macro()
    Application.ScreenUpdating = False
    Dim count
    count = 1
    Do Until Range("A" & count) = ""
        If Range("H" & count) > 0 Then
            Range("E" & count & ":H" & count).Cut
            Range("A" & count + 1 & ":D" & count + 1).Insert shift:=xlDown
        Else
            Range("E" & count & ":H" & count).Cells.Clear
        End If
        count = count + 1
    Loop
    Application.ScreenUpdating = True
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1