Results 1 to 5 of 5

autofill horizontally headres for the whole used range

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    447

    autofill horizontally headres for the whole used range

    Hi,

    I would like to autofill horizontally in order to create headers in the first row for all the columns in the used range.
    With my macro the autofill only stretches to the column in which in the first row a value is displayed. I would like to autofill horizontally for all the columns in the used range, so also for columns that have values in other rows than the second. So the headers should be "header 1", "header 2", etc.
    How can this be done?

    Sub invoegen_kopteksten() 'voegt kopteksten "Waarde1" , etc. toe aan de kolommen
    
        [d1] = "header 1"
        
        Cells(1, 4).AutoFill Destination:=Range(Cells(1, 4), Cells(1, Cells(4, Columns.Count).End(xlToLeft).Column))
    
    End Sub
    Last edited by MaartenRo; 08-26-2022 at 06:53 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 11-21-2018, 04:59 PM
  2. Autofill Horizontally
    By trescuervo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2018, 10:51 PM
  3. [SOLVED] Autofill horizontally while maintaining formulas
    By pittsburghr2 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-06-2014, 01:27 AM
  4. Can you autofill horizontally and vertically?
    By keez1993 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-27-2014, 03:59 AM
  5. [SOLVED] autofill vertical list horizontally with 2 blank cells in-between each list item
    By Phily915 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-14-2014, 08:15 PM
  6. Autofill horizontally
    By JaDiMa in forum Excel General
    Replies: 23
    Last Post: 06-06-2010, 03:26 PM
  7. Autofill horizontally
    By skatmandu2002 in forum Excel General
    Replies: 4
    Last Post: 01-23-2009, 07:52 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