mostafaghih
New Member
- Joined
- Feb 11, 2017
- Messages
- 2
I am getting confused that why excel do the actions to all grouped sheets except this action that I really need it.
I want to insert Row by selecting range of cells and then insert entire row.
it makes me more confused that it works when I do it manually and also recording macro. I mean all grouped sheets row is inserted. but when I run the recorded macro it just insert a row just to the activated sheet but not to all selected sheets. here is the codes:
thanks for your help.
sub macro1()
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets("Sheet1").Activate
Range("B5:D5").Select
Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
end sub
I want to insert Row by selecting range of cells and then insert entire row.
it makes me more confused that it works when I do it manually and also recording macro. I mean all grouped sheets row is inserted. but when I run the recorded macro it just insert a row just to the activated sheet but not to all selected sheets. here is the codes:
thanks for your help.
sub macro1()
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets("Sheet1").Activate
Range("B5:D5").Select
Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
end sub