Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Equal = both value and format of another cell

How can I modify the formula of equals (=) so that it equals both the value
and formatting of another cell?
--
KBC
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Equal = both value and format of another cell

Right click sheet tabview codecopy/paste this. You may want to restrict to
certain cells.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Range(Cells.Find(Target).Address).Copy
Target.PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False
Application.EnableEvents = True
End Sub

--
Don Guillett
SalesAid Software

"Kevin BC" wrote in message
...
How can I modify the formula of equals (=) so that it equals both the
value
and formatting of another cell?
--
KBC


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Equal = both value and format of another cell

Is the formatting likely to change then? if not just copy, paste special -
formats.


If yes the format will be changing then cant you put conditional formatting
on the destination cell the same as the 'linked to' cell?

hope im understanding you correctly here.

"Kevin BC" wrote:

How can I modify the formula of equals (=) so that it equals both the value
and formatting of another cell?
--
KBC

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default Equal = both value and format of another cell

Hi,

If I understand your question I can't get the previous solution to work so
try this:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Err1
Application.EnableEvents = False
X = Target.Dependents.Address
Target.Copy
Range(X).PasteSpecial xlPasteFormats
Err1:
Application.EnableEvents = True
End Sub

Note that this applies to All cells on the current worksheet that have
formulas. If you want to limit those to certain cells please let us know.
Also changing the cells format does not trigger these macros, only change the
entry in the cell. To handle a cell formatting change without changing the
value in the cell will present more of a challenge, so let us know.

--
Cheers,
Shane Devenshire


"Kevin BC" wrote:

How can I modify the formula of equals (=) so that it equals both the value
and formatting of another cell?
--
KBC

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
can I make cell "yes" equal 1, "no" equal 0 can I make cell yes equal 1, no equa Excel Discussion (Misc queries) 4 April 22nd 23 06:09 AM
How to point to (select) a cell to the left from a cell where I enter the = equal sign? Dmitry Excel Discussion (Misc queries) 4 June 30th 06 06:49 AM
Setting a cell equal to another worksheet cell fails (sometimes) Richard Excel Worksheet Functions 2 March 10th 06 04:11 AM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM
Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 7th 04 10:50 PM


All times are GMT +1. The time now is 11:32 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"