View Single Post
 
Old 08-24-2023, 03:52 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2021
Expert
 
Join Date: Apr 2014
Posts: 956
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

By inserting cells with
Selection.Insert Shift:=xlToRight
you have moved your t1 range to the right. If those cells had values, they too would move to the right.
Maybe this will show you what goes on and what you can do. Step through the code with F8 on the keyboard:
Code:
Sub monthprocess()
Dim t1 As Range, tNew As Range

Set t1 = Selection
Selection.Insert Shift:=xlToRight
Set tNew = Selection 'because the newly inserted range is selected

t1.Select
tNew.Select
End Sub
Reply With Quote