+ Reply to Thread
Results 1 to 4 of 4

Move data from template to excel col.

Hybrid View

visha_1984 Move data from template to... 03-24-2016, 09:21 AM
antoka05 Re: Move data from template... 03-24-2016, 10:03 AM
visha_1984 Re: Move data from template... 03-24-2016, 11:02 AM
antoka05 Re: Move data from template... 03-24-2016, 11:27 AM
  1. #1
    Forum Contributor visha_1984's Avatar
    Join Date
    11-27-2012
    Location
    Pune,India
    MS-Off Ver
    Excel 2013
    Posts
    309

    Move data from template to excel col.

    Hi All,

    I am doing one project need help in this,there is so many template in workbook,i need to move them in single sheet, yellow mark are headers and red marks is data in template.sorry bad English.

    i have attached workbook with input and output.
    any help much appreciate.


    visha
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Move data from template to excel col.

    You could use this code:
    Sub Macro1()
       Dim sh As Worksheet
       Dim myArray As String
       Dim destRow As Long, lastRow As Long
       Dim destCol As Integer, myCell
       
       myArray = "c5,g5,c6,g6,c8,g8,c9,g9,c10,g10,c11,g11,g12,g13,c14"
       destRow = 1
       With ThisWorkbook
          For Each sh In .Sheets
             If LCase(sh.Name) <> "output" Then
                destRow = destRow + 1
                lastRow = sh.Cells(Rows.Count, 1).End(xlUp).Row
                
                destCol = 0
                For Each myCell In Split(myArray, ",")
                   destCol = destCol + 1
                   .Sheets("output").Cells(destRow, destCol) = sh.Range(myCell)
                Next
                
                destCol = destCol + 1
                .Sheets("output").Cells(destRow, destCol).Resize(lastRow - 16, 8).Value = sh.Range("a17").Resize(lastRow, 8).Value
                destRow = destRow + lastRow - 17
             End If
          Next
       End With
    End Sub
    Regards,
    Antonio

  3. #3
    Forum Contributor visha_1984's Avatar
    Join Date
    11-27-2012
    Location
    Pune,India
    MS-Off Ver
    Excel 2013
    Posts
    309

    Re: Move data from template to excel col.

    FANTASTIC Antonio u save my daily 3 hours ,thank u very much.

  4. #4
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Move data from template to excel col.

    I'm glad that you could fix it!
    Regards,
    Antonio

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Move client data to record and clear the input template
    By ronettes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2015, 01:41 PM
  2. Move data to new sheet and create copy of template sheet
    By jdm13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2014, 01:53 PM
  3. Replies: 2
    Last Post: 05-04-2012, 04:57 PM
  4. Replies: 1
    Last Post: 07-16-2009, 09:14 PM
  5. Template update database, auto move down 1 row
    By SteveT in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-06-2006, 05:55 PM
  6. How do I move files that are linked with template wizard?
    By most xlent in forum Excel General
    Replies: 0
    Last Post: 03-21-2005, 02:06 PM

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