Results 1 to 12 of 12

first sheet column "E" value copy to second sheet column "I"

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Post first sheet column "E" value copy to second sheet column "I"

    what this macro doing is ,after enter values to second sheet column "F" it's matching with first sheet("order history") column "M" & picking data to second sheet.

    Option Explicit
    Sub MoveData(ws As Worksheet, Target As Range)
        Dim found As Range
        Dim i As Long, r As Long, trow As Long
        Dim copyCols, pasteCols
        trow = Target.Row
        With ThisWorkbook.Sheets("order history")
            Set found = .Range("m:m").Find(Left(Target, 6), , -4163)
            If Not found Is Nothing Then
                r = found.Row
                Application.ScreenUpdating = False
                Application.Calculation = xlCalculationManual
                If r > 2 Then
                    copyCols = Split("D,H,F,G,I,C", ",")
                    pasteCols = Split("A,B,C,D,E,H", ",")
                    If UBound(copyCols) = UBound(pasteCols) Then
                        For i = 0 To UBound(pasteCols)
                            Cells(trow, pasteCols(i)).Value = _
                                    .Cells(r, copyCols(i)).Value
                        Next i
                    End If
                Else
                    Range("A" & trow & ":E" & trow).ClearContents
                    Range("H" & trow).ClearContents
                End If
                Application.ScreenUpdating = True
                Application.Calculation = xlCalculationAutomatic
            End If
        End With
    End Sub
    at the moment this macro coping first sheet column D,H,F,G,I,C values to second sheet A,B,C,D,E,H.

    my requirement is same like others,first sheet column "E" value need to copy to second sheet column "I" ,if first sheet column "E" is empty then same row column "H" value i want to copy to column "I".pls add this modification to this macro.thanks in advance.
    Last edited by johncena; 04-17-2012 at 10:01 AM.

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