Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Vsn Vsn is offline
external usenet poster
 
Posts: 21
Default remove all format(s) on a sheet

Hi all,

Is the a way in with VBA code to remove ALL formats from a sheet, including
lines, width, text bold, etc., and set all back to default.

This would be very helpfull to me.

Thanks,
Ludovic


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default remove all format(s) on a sheet

On Sun, 15 Nov 2009 16:31:21 +0100, "Vsn" <vsn_hotmail_kom wrote:

Hi all,

Is the a way in with VBA code to remove ALL formats from a sheet, including
lines, width, text bold, etc., and set all back to default.

This would be very helpfull to me.

Thanks,
Ludovic



Try this:

1) Insert a new worksheet into the workbook.
2) Select everything on the new worksheet (CTRL+A)
3) Copy everything from the new worksheet (CTRL+C)
4) Select everything on the worksheet you want to clean up (CTRL+A).
5) Paste Special and select Formats in the Paste section.

This will reset the formatting to the same as for a new worksheet.
You can now delete the worksheet from step 1.

Hope this helps / Lars-Åke

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default remove all format(s) on a sheet

ActiveSheet.Cells.ClearFormats


"Vsn" <vsn_hotmail_kom wrote in message
...
Hi all,

Is the a way in with VBA code to remove ALL formats from a sheet,
including lines, width, text bold, etc., and set all back to default.

This would be very helpfull to me.

Thanks,
Ludovic



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default remove all format(s) on a sheet

Assuming you want to set your fonts back to the default values as well, give
this a try...

With ActiveSheet.Cells
.ClearFormats
.Font.Name = Application.StandardFont
.Font.Size = Application.StandardFontSize
End With

--
Rick (MVP - Excel)


"Vsn" <vsn_hotmail_kom wrote in message
...
Hi all,

Is the a way in with VBA code to remove ALL formats from a sheet,
including lines, width, text bold, etc., and set all back to default.

This would be very helpfull to me.

Thanks,
Ludovic


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default remove all format(s) on a sheet

On Sun, 15 Nov 2009 10:59:49 -0500, "Rick Rothstein"
wrote:

Assuming you want to set your fonts back to the default values as well, give
this a try...

With ActiveSheet.Cells
.ClearFormats
.Font.Name = Application.StandardFont
.Font.Size = Application.StandardFontSize
End With


Column Widths and Row Heights don't seem to be reset by .ClearFormats

Lars-Åke


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default remove all format(s) on a sheet

I wasn't sure if the OP wanted Column Widths and Row Heights reset as well,
but I doing that that makes sense. Assuming the last row and last column
have not been changed, then I guess you could "steal" the ColumnWidths and
RowHeights values from them...

Rows.RowHeight = Rows(Rows.Count).RowHeight
Columns.ColumnWidth = Columns(Columns.Count).ColumnWidth

--
Rick (MVP - Excel)


"Lars-Åke Aspelin" wrote in message
...
On Sun, 15 Nov 2009 10:59:49 -0500, "Rick Rothstein"
wrote:

Assuming you want to set your fonts back to the default values as well,
give
this a try...

With ActiveSheet.Cells
.ClearFormats
.Font.Name = Application.StandardFont
.Font.Size = Application.StandardFontSize
End With


Column Widths and Row Heights don't seem to be reset by .ClearFormats

Lars-Åke


  #7   Report Post  
Posted to microsoft.public.excel.programming
Vsn Vsn is offline
external usenet poster
 
Posts: 21
Default remove all format(s) on a sheet

This works perfect, thanks a lot!

Ludovic

"Rick Rothstein" schreef in bericht
...
I wasn't sure if the OP wanted Column Widths and Row Heights reset as well,
but I doing that that makes sense. Assuming the last row and last column
have not been changed, then I guess you could "steal" the ColumnWidths and
RowHeights values from them...

Rows.RowHeight = Rows(Rows.Count).RowHeight
Columns.ColumnWidth = Columns(Columns.Count).ColumnWidth

--
Rick (MVP - Excel)


"Lars-Åke Aspelin" wrote in message
...
On Sun, 15 Nov 2009 10:59:49 -0500, "Rick Rothstein"
wrote:

Assuming you want to set your fonts back to the default values as well,
give
this a try...

With ActiveSheet.Cells
.ClearFormats
.Font.Name = Application.StandardFont
.Font.Size = Application.StandardFontSize
End With


Column Widths and Row Heights don't seem to be reset by .ClearFormats

Lars-Åke




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copied from web page to excel sheet and cant remove from sheet mitch Excel Worksheet Functions 2 May 4th 10 07:58 PM
copied from web page to excel sheet and cant remove from sheet mitch Excel Worksheet Functions 0 May 4th 10 05:38 PM
cell format - remove cell format pattern without effecting colors Bas Excel Discussion (Misc queries) 1 March 23rd 09 02:54 PM
How to remove PivotTable format. MichaelRobert Excel Worksheet Functions 3 February 13th 09 02:21 PM
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B Hannes Heckner Excel Programming 1 March 5th 04 09:10 AM


All times are GMT +1. The time now is 11:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"