+ Reply to Thread
Results 1 to 5 of 5

VB Code to convert sheet data into tabular format

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to convert sheet data into tabular format

    Hello:

    Please refer to attached file.
    I have monthly data as shown.
    I need to convert these data in Tabular format as shown in Sheet "TableFormat" Column I thru K.
    Do not need data for cell which is blank.
    SO basically need to go thru all months tab and go thru each day in column A.

    Let me know if you have any questions.
    Thanks.

    R
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: VB Code to convert sheet data into tabular format

    HOw about a pivot table as shown in attached?
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to convert sheet data into tabular format

    Hello alan:

    I really needed VB code as the data will be linked further,
    Thanks a lot

    R

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: VB Code to convert sheet data into tabular format

    This may not be useful either however as the post has been here a few days I thought I would offer.
    Power Query, which I believe to be an Add-in for the 2010 version was used to make the following:
    1. Convert the ranges to tables
    2. load the tables one at a time into Power Query and paste the following* in the advanced editor:
    Please Login or Register  to view this content.
    *Note that in the first line the name of the table will need to be changed each time i.e. from tbl_Jan_2018 to tbl_Feb_2018
    3. Choose Close and Load To: and then connection only
    4. Once you have made connections to all tables you can then use the Append feature (For the 2019 version select Get Data then Combine Queries then Append)
    5. Choose Close and Load.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this !


    A starter demonstration to paste to the TableFormat worksheet module :

    PHP Code: 
    Sub Demo1()
     
    Dim L&, Ws As WorksheetWV(), N&, R&, C%
         
    2
    For Each Ws In ThisWorkbook.Worksheets
      
    If Not Ws Is Me Then
         W 
    Ws.[A1].CurrentRegion.Value
         ReDim V
    (1 To (UBound(W2) - 2) * (UBound(W) - 1), 2)
            
    0
        
    For 2 To UBound(W)
            If 
    W(R1Then
                
    For 3 To UBound(W2)
                    If 
    W(RCThen N 1V(N0) = W(R1): V(N1) = W(1C): V(N2) = W(RC)
                
    Next
            End 
    If
        
    Next
            Cells
    (L1).Resize(N3).Value V
            L 
    N
      End 
    If
    Next
        Me
    .ListObjects(1).Range.Columns.AutoFit
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 08-24-2019 at 09:12 PM.

+ 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. [SOLVED] Formula to reorganzie data in tabular format
    By rizmomin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-20-2018, 01:39 PM
  2. Convert tabular data into subtitle text file format (.srt) UTF-8
    By sabha in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-22-2018, 11:18 AM
  3. Replies: 3
    Last Post: 11-02-2017, 10:01 AM
  4. Replies: 2
    Last Post: 05-14-2016, 06:01 AM
  5. [SOLVED] Macro to Format Store Data in a Tabular Format
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2015, 04:38 AM
  6. Transpose data into a tabular format
    By fausto1234 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-09-2012, 02:04 AM
  7. How to Convert Matrix format data into tabular format data
    By nishchints in forum Excel General
    Replies: 1
    Last Post: 02-22-2012, 03:53 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