Hello Yasser,
I am just a little curious, that's all…
Are you sure you want what Hans’s macro does?
If this is your before worksheet,
http://i.imgur.com/I4IjZz9.jpg
UnmovedD.JPG
Then, if you apply Hans macro in this form,
Code: Select all
Sub Insertses() ' https://eileenslounge.com/viewtopic.php?p=280700#p280700
Dim Sh As Worksheet: Set Sh = ActiveSheet
Dim Lr As Long: Let Lr = 9
Dim rng As Range
Set rng = Sh.Range("D7:D" & Lr)
Do
rng.Insert Shift:=xlToRight
Loop Until rng.Column = 9
End Sub
Then this is your result:
http://i.imgur.com/VJY5DvW.jpg
MovedD.JPG
If that is what you want, then fair enough. No Problem. - It just seems a bit strange to me that you want to do that.
So I was just checking, that’s all
Alan
BTW, these macros will produce the same final results
Code: Select all
Sub InsertOnce()
Dim Sh As Worksheet: Set Sh = ActiveSheet
Dim Lr As Long: Let Lr = 9
Dim rng As Range
Set rng = Sh.Range("D7:H" & Lr)
rng.Insert Shift:=xlToRight
End Sub
Code: Select all
Sub Insertseses2() ' https://eileenslounge.com/viewtopic.php?p=280700#p280700
Dim Sh As Worksheet: Set Sh = ActiveSheet
Dim Lr As Long: Let Lr = 9
Dim rng As Range
Set rng = Sh.Range("D7:D" & Lr)
rng.Resize(, 5).Insert Shift:=xlToRight
End Sub
You do not have the required permissions to view the files attached to this post.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also