Add a block of row in a table by keeping the layout and the security

0

Dear experts,

I have a table with sections (containing several rows). I would like to add via a button a new section with the same information except some calculation results:

52705_5fa15f372c008116568142.png

So I want to add a bloc of 4 rows at the end of the table. This bloc should start with the number of the 1st column incremented(here 3). Texts should be the same than the previous section. The red columns should be equals and cannot be modified (so the parameter of the cells should be marked as locked). The yellow fields can be changed and the Total column is calculated by default and cannot be modified (so the parameter of the cells should be marked as locked)

The layout (colors and borders) should be respected., That's signified that the external border of the table should be kept.

I try to do that but I cannot respectthe layout :

    Range("A50").Select
    Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
    Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
    Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
    Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
    Range("A50:F53").Select
    Selection.Copy
    Range("A50").Select
    ActiveSheet.Paste

Could you help me please with that ?

Thanks in advance for your help.


Posté le 4 novembre 2020, 16:43
par amadeise
Répondre

Si vous n'êtes pas inscrit sur le site, vous pouvez poster librement (en tant qu'invité).
Pour cela, indiquez un pseudonyme (nom d'utilisateur) et une adresse email :