#1   Report Post  
Shawn
 
Posts: n/a
Default Freeze Formatting

I'm trying to develop a way to freeze the formatting of a cell or group of
cells (lines and shading). What I need to be able to do is click and drag
the contents of a cell to another cell while maintaining the original
formatting of the originating and destination cell.
-Shawn
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Maybe you could catch the change, save the new formula/value, do an undo and
then reapply the formula/value.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Dim myFormulas As Variant

On Error GoTo errHandler:

myFormulas = Target.Formula
With Application
.EnableEvents = False
.Undo
End With
Target.Formula = myFormulas

errHandler:
Application.EnableEvents = True

End Sub

This is an event macro. Rightclick on the worksheet tab that should have this
behavior. Select view code and paste this into the code window. Then back to
excel and test it out.

But that breaks if macros are disabled or events are disabled.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Shawn wrote:

I'm trying to develop a way to freeze the formatting of a cell or group of
cells (lines and shading). What I need to be able to do is click and drag
the contents of a cell to another cell while maintaining the original
formatting of the originating and destination cell.
-Shawn


--

Dave Peterson
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
Losing conditional formatting when saving Eric FD Excel Discussion (Misc queries) 3 January 18th 05 11:42 PM
Determine cells that drive conditional formatting? Nicolle K. Excel Discussion (Misc queries) 2 January 7th 05 01:08 AM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM
Id like to freeze the first row for headers and freeze the very b. Bill Charts and Charting in Excel 2 December 17th 04 09:13 PM
Cells losing formatting BdgBill Excel Discussion (Misc queries) 1 November 26th 04 08:03 AM


All times are GMT +1. The time now is 10:30 PM.

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

About Us

"It's about Microsoft Excel"