PDA

View Full Version : Keep cell font bold off



sujittalukde
12-26-2007, 11:05 PM
I am usding the following code to insert a row between two rows. These two rows have bold font. I wnat to insert rows between two rows and also want to keep the font of nwely inserted rows as regular font ie without bold. THis code keeps the bold off when the row is inserted. But as soon as a text data is written on the cell , it is converted to bold.
Suppose A7 and A8 is bold font cells. NOw I am inserting a row at A8 with this code. Bold for A8 is kept off with this code but as soon as a data is entered in A8 it is converting to bold which I wnat to keep normal ie without bold.


Sub insertrow()
ActiveCell.EntireRow.Insert
ActiveCell.Font.Bold = False
ActiveCell.Select
ActiveCell.Font.Bold = False
End Sub

Why is this happening? How to correct this?

anandbohra
12-26-2007, 11:54 PM
WORKING FINE at my end. no problem in code :yes

pl upload the file

sujittalukde
12-27-2007, 12:11 AM
Thanks for the reply I have checked the code once more and found that this code works well upto row 10 In case I have data fiiled in say upto row20 ie A20 with bold on and if I run the code from A10 and onwards then the problem comes in.

anandbohra
12-27-2007, 12:18 AM
the problem is not with your code but with the EXCEL default feature which extend the formating to data range.

follow this steps
go to tools - Options - under edit tab
uncheck this option
"Extend data range formats & formulas"

this will now stop making your inserted row bold automatically