Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 73
Default how do I create a link for both content and format of the cell?

When I insert a link to a cell in Excell, the destination cell shows data
content but not the format of the source cell. How do I create a link so that
the destination cell shows both data content and format of the source cell?

Thank you for your help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default how do I create a link for both content and format of the cell?

Linking only picks up the value of the source cell. It is possible, using
VBA to determine if a cell is a link, reach back to the source, copy the
format and paste it back into the destination cell:


Sub format_painter()
Dim r, r2 As Range
Dim s As String
Dim b As Boolean
For Each r In Selection
If r.HasFormula Then
s = r.Formula
s = Right(s, Len(s) - 1)
On Error Resume Next
Set r2 = Range(s)
On Error GoTo 0
b = Not r2 Is Nothing
If b Then
r2.Copy
r.PasteSpecial Paste:=xlPasteFormats
End If
End If
Next
End Sub

--
Gary's Student


"Becky" wrote:

When I insert a link to a cell in Excell, the destination cell shows data
content but not the format of the source cell. How do I create a link so that
the destination cell shows both data content and format of the source cell?

Thank you for your help.

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 Excel 2003 cell link carry with it the source cell format? tom Excel Discussion (Misc queries) 2 July 14th 06 06:14 AM
Pick up format from another cell Kathrine J Wathne Excel Discussion (Misc queries) 5 June 15th 06 11:43 PM
Conditional Formatting if cell content is a formula oldsambvca Excel Worksheet Functions 2 June 6th 06 10:24 PM
replace one tag in content of one cell and format not changed replace one tag in content of one cell a Excel Discussion (Misc queries) 1 January 9th 06 03:36 PM
How do I copy a cell (content AND format) from one worksheet to a. Excel Format Copy Excel Worksheet Functions 1 February 9th 05 10:34 PM


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