Results 1 to 7 of 7

need vba code to copy set of data in row to column

Threaded View

  1. #4
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: need vba code to copy set of data in row to column

    Hi
    Sub test()
        Dim ar As Range
        Dim a As Variant
        Dim i As Long
        i = 1
        For Each ar In Sheets("rawdata").Columns("A:A").SpecialCells(2, 23).Offset(1).Areas
            a = Application.Transpose(ar)
            ReDim Preserve a(1 To UBound(a) + 1)
            a(7) = IIf(a(7) = "", 0, a(7))
            a(8) = Split(a(2), "$")(1)
            Sheets("EXPECTED Result").Cells(2 + i, 1).Resize(, 8) = Application.Index(a, 0, Array(2, 1, 3, 4, 5, 6, 7, 8))
            i = i + 1
        Next
        Sheets("EXPECTED Result").Columns("E").NumberFormat = "h:mm"
    End Sub
    Last edited by mohadin; 04-11-2021 at 07:49 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How does the VBA code copy the data in column A to the merged cell in column D?
    By rayhen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-03-2020, 09:52 AM
  2. [SOLVED] VB Code to copy paste data from column to another column based on content of cell
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2019, 08:50 PM
  3. [SOLVED] VBA code: copy/paste data from 2 two columns into one column
    By Tapyr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-23-2015, 07:19 AM
  4. VBA to copy down Vlookup VBA code in Column till last available data
    By shansakhi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2014, 08:09 AM
  5. [SOLVED] Find a value in a column and copy all data above that row code not working.
    By klunker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2014, 08:44 AM
  6. [SOLVED] VBA code to copy column data only if headers match
    By rocksan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2012, 11:23 PM
  7. VBA Code to copy data from last filled column and paste to the next available column.
    By Pavman2473 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2012, 09:07 PM

Tags for this Thread

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