Hi,
I have added a new column as the last column to an existing excel using VBA. After adding a new column, though the background color and other format properties same as that of the adjacent column are applied to the column that I inserted, the grid lines it did not copy the same grid borders as that of adjacent column to the last column that I inserted. I have used the code below to copy the format. With this code all the columns that I inserted do not have any grid borders. Could you please help me resolve this issue?
Code snippet that I am using:
'Insert the new column as the last column in the Consumption sheet
For Each myFoo In myNewColumns
Columns(myLastCol + 1).Insert CopyOrigin:=xlFormatFromLeftOrAbove
Cells(myHeaderRow, myLastCol + 1).Value = myFoo
Next myFoo
Thank you.
Best Regards,
bhandarx
I have added a new column as the last column to an existing excel using VBA. After adding a new column, though the background color and other format properties same as that of the adjacent column are applied to the column that I inserted, the grid lines it did not copy the same grid borders as that of adjacent column to the last column that I inserted. I have used the code below to copy the format. With this code all the columns that I inserted do not have any grid borders. Could you please help me resolve this issue?
Code snippet that I am using:
'Insert the new column as the last column in the Consumption sheet
For Each myFoo In myNewColumns
Columns(myLastCol + 1).Insert CopyOrigin:=xlFormatFromLeftOrAbove
Cells(myHeaderRow, myLastCol + 1).Value = myFoo
Next myFoo
Thank you.
Best Regards,
bhandarx