Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tim Laplaca
 
Posts: n/a
Default Locking a cell's format, but not value

Hello,

I did some searches and although I found some other threads discussing
this, I found no working solution. I suspect what I want cannot be
done, but I am asking anyway in case there is a solution that was
missed or perhaps a method became available in later versions of Excel
or via patches.

I would like to lock or freeze the format of a cell, so that a user can
copy a value from another cell to it, without the format also being
copied. I realize this can be done with 'Paste Special', but I find
that method too cumbersome to expect my users to use.
I am using Excel 2003 (11.6113.5703).

Thanks,
Tim

  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

You can use an event macro to reset the format whenever the cell value
changes. For instance:


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("C2, J9")) Is Nothing Then
With Range("C2, J9")
.NumberFormat = "0.000_);[Red](0.000)"
.Interior.ColorIndex = 34
End With
End If
End Sub

Put this in the worksheet code module (right-click the worksheet tab and
choose View Code).

This won't keep a user from directly changing the format, but it will
reset it if another value is entered, either directly or with copy/paste.


In article .com,
"Tim Laplaca" wrote:

I did some searches and although I found some other threads discussing
this, I found no working solution. I suspect what I want cannot be
done, but I am asking anyway in case there is a solution that was
missed or perhaps a method became available in later versions of Excel
or via patches.

I would like to lock or freeze the format of a cell, so that a user can
copy a value from another cell to it, without the format also being
copied. I realize this can be done with 'Paste Special', but I find
that method too cumbersome to expect my users to use.
I am using Excel 2003 (11.6113.5703).

  #3   Report Post  
Tim Laplaca
 
Posts: n/a
Default

That's probably a pretty good solution, I'll give it a try. Thanks!

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
Heps to design Locked/Unlocked cells in protected worksheet Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:09 AM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM
I want to format a cell based on an adjacent cells value Cumbo Excel Discussion (Misc queries) 1 December 13th 04 11:52 AM
how do you format a row of cells based upon a value in another ce. hazenb1 Excel Discussion (Misc queries) 1 December 9th 04 04:22 AM
Protected cells -automatically format to a different color Fred Evans Excel Discussion (Misc queries) 9 December 3rd 04 12:59 PM


All times are GMT +1. The time now is 10:02 AM.

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"