The Macro Affect some cells font formatting

Ramadan

Board Regular
Joined
Jan 20, 2024
Messages
85
Office Version
  1. 2021
Platform
  1. Windows
I have a worksheet with a table and a macro to insert new row to the table. under the table there is a total row doesn't included in the table range

the problem is every time when I click the macro button to add new row the font format of the total row below the table changes from bold to regular only in 2 cells as you can see in the screenshot "F179" & "L179" and I don't know what's the wrong in the code to do that..

VBA Code:
[Sub Addnewrow()

Dim ws As Worksheet
Dim newrow As ListRow

Set ws = ActiveSheet

Set newrow = ws.ListObjects("Data").ListRows.Add

With newrow
.Range(12).FillDown

End With

End Sub]
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    113.1 KB · Views: 11

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,225,267
Messages
6,183,935
Members
453,197
Latest member
Choppa1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top