Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / June 2007

Tip: Looking for answers? Try searching our database.

Equal = both value and format of another cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin BC - 15 Jun 2007 16:02 GMT
How can I modify the formula of equals (=) so that it equals both the value
and formatting of another cell?
Signature

KBC

Don Guillett - 15 Jun 2007 16:28 GMT
Right click sheet tab>view code>copy/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

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

> How can I modify the formula of equals (=) so that it equals both the
> value
> and formatting of another cell?
oli merge - 15 Jun 2007 16:35 GMT
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.

> How can I modify the formula of equals (=) so that it equals both the value
> and formatting of another cell?
ShaneDevenshire - 15 Jun 2007 18:37 GMT
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.

Signature

Cheers,
Shane Devenshire

> How can I modify the formula of equals (=) so that it equals both the value
> and formatting of another cell?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.