View Single Post
 
Old 05-13-2021, 02:39 AM
rollis13's Avatar
rollis13 rollis13 is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Jan 2021
Location: Cordenons
Posts: 140
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