Insert a row without taking formats from above (upper) rows or cells

E

edrikhart

I guess I need a VB code (or anything else) to prevent the excel from inheriting formats from upper row when I insert a row under a formatted row.

I know there is option to disable it but I need it only effects to one excel sheet which also has other VB codes.

I would also appreciated If you also you show me how I can code to prevent certain type of formats. I mean, the I inserted row only inherits "BOLD" from the upper row. A reference of functions would help.

Thanks
 
C

Claus Busch

Hi,

Am Thu, 14 Mar 2013 13:56:09 -0700 (PDT) schrieb (e-mail address removed):
I guess I need a VB code (or anything else) to prevent the excel from inheriting formats from upper row when I insert a row under a formatted row.

I know there is option to disable it but I need it only effects to one excel sheet which also has other VB codes.

I would also appreciated If you also you show me how I can code to prevent certain type of formats. I mean, the I inserted row only inherits "BOLD" from the upper row. A reference of functions would help.

e.g. try:
Rows("2:2").Insert Shift:=xlDown
Rows("2:2").ClearFormats


Regards
Claus Busch
 
T

thelordmorgoth

Hi,



Am Thu, 14 Mar 2013 13:56:09 -0700 (PDT) schrieb (e-mail address removed):






e.g. try:

Rows("2:2").Insert Shift:=xlDown

Rows("2:2").ClearFormats





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2

Thanks for quick reply. Let me explain it again.

I have a excel sheet with all kind of data. I wants to insert a row manually (Right click on a selected row and select click Insert) between the rows which contains data. So when I want to add new data to the newly added row the cell takes formats from the upper cell (Row). I don't want that thing happen.

For example If I add 3rd row below the 2nd row , whatever I type in the 3rdrow it take formats from the 2nd row.
 
G

GS

Is there some reason why clicking 'Clear Formatting' on the 'Insert
Options' popup (format icon that displays) doesn't work?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
T

thelordmorgoth

Is there some reason why clicking 'Clear Formatting' on the 'Insert

Options' popup (format icon that displays) doesn't work?



--

Garry



Free usenet access at http://www.eternal-september.org

Classic VB Users Regroup!

comp.lang.basic.visual.misc

microsoft.public.vb.general.discussion

Yes, for example lets say that I need to keep all formats except the color or Bold.
 
G

GS

Yes, for example lets say that I need to keep all formats except the
color or Bold.

Well.., you're going to have to specify exactly what formatting to keep
and so (while the inserted row is highlighted it will be easier) if you
don't want boldface then Ctrl+B toggles that. Change the color on the
Formatting toolbar.

However, you specifically asked how to prevent auto formatting and that
is what my reply addressed.

Optionally, you can design a custom 'Style' and apply that to the
inserted row while it's highlighted.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
C

CellShocked

Is there some reason why clicking 'Clear Formatting' on the 'Insert
Options' popup (format icon that displays) doesn't work?


I have always found that an insert event causes such a copying,

If you highlight a blank row, and use copy and "insert copied cells",
the 'row insertion' will carry the formatting of the original copied row.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top