Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-13-2021, 02:39 AM
rollis13's Avatar
rollis13 rollis13 is offline auto fill numbers Windows 10 auto fill numbers Office 2016
Competent Performer
 
Join Date: Jan 2021
Location: Cordenons
Posts: 143
rollis13 will become famous soon enough
Default

Then try with this macro:
Code:
Option Explicit
Sub test()
    Dim i      As Long
    Dim x      As Long
    Dim col    As Long
    i = 2
    col = Cells(1, Cells.Columns.Count).End(xlToLeft).Column    'use if there is no data after the last used column in row 1
    'col = Cells(1, 1).End(xlToRight).Column    'use if there are no empty columns before the last used in row 1
    Do Until Cells(i, 1) = ""
        For x = 1 To col
            Cells(i, col * 2 - x + 1) = Cells(i, x) + 1
        Next x
        i = i + 1
    Loop
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
auto fill up mare1984 Word 1 06-27-2019 08:09 PM
auto fill numbers Auto Fill Forms pgilbert0824 Excel 2 10-30-2016 01:02 AM
auto fill numbers Excel Auto-fill Issues officeboy09 Excel 8 01-14-2014 05:52 PM
auto fill a word doc from another program hcubed Office 0 06-19-2013 09:42 PM
auto fill numbers Auto Color Fill Question Kinar Excel 3 05-14-2013 07:46 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft