+ Reply to Thread
Results 1 to 3 of 3

Macro to put the table title left at each table's row

Hybrid View

  1. #1
    Registered User
    Join Date
    07-30-2014
    Location
    Amsterdam, Holland
    MS-Off Ver
    Office 2013
    Posts
    33

    Macro to put the table title left at each table's row

    Hello,

    I need a macro that places the value on top of each table in the example, left to the column. A macro is needed because I have a lot of this sheets with a lot of tables vertically ordered. Also all the tables have a different amount of rows.

    See the added example with the needed solution.

    Thanks in advance
    Attached Files Attached Files
    Last edited by VincentNL; 11-28-2014 at 08:49 AM.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Macro to put the table title left at each table's row

    Try:
    Sub foo()
        Dim l As Long, s As String
        With ActiveSheet
            For l = 1 To .Cells(Rows.Count, 2).End(xlUp).Row
                If Not .Cells(l, 2).Value = "" Then
                    If .Cells(l, 3).Value = "" Then
                        s = .Cells(l, 2).Value
                    Else
                        .Cells(l, 1).Value = s
                    End If
                End If
            Next l
        End With
    End Sub
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-30-2014
    Location
    Amsterdam, Holland
    MS-Off Ver
    Office 2013
    Posts
    33

    Re: Macro to put the table title left at each table's row

    Hi Olly,

    Works perfectly, thanks!

    Vincent

+ 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. Is it possible to use VBA to insert a title into a pivot table?
    By Smudge.Smith in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2014, 11:29 AM
  2. [SOLVED] Changing data on table according to title
    By efemko in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2014, 04:33 PM
  3. [SOLVED] extracting column title from a table
    By tiger234 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-06-2012, 06:20 AM
  4. Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.
    By Michell Feitosa in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-04-2012, 08:10 PM
  5. How to make visible the title of the table?
    By mari - ExcelForums.com in forum Excel General
    Replies: 2
    Last Post: 02-26-2005, 12:07 AM

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