Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old February 9th 05, 10:03 PM
Excel Format Copy
 
Posts: n/a
Default How do I copy a cell (content AND format) from one worksheet to a.

What worksheet function will copy both the content AND format of a cell in
one worksheet to a cell in another worksheet? I want to copy both text or
data and the format such as background color or border, under program
control. This would be a combination of both "=" function and "Format
Painter".

  #2   Report Post  
Old February 9th 05, 10:34 PM
Jason Morin
 
Posts: n/a
Default

You have to use VBA. What you could do is use a
worksheet change event so when you change the value in
for example, B3 on Sheet1, it copies the value and format
(change the formats first in B3 before the value), to
cell B10 on Sheet2. Something like:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim FromWS As Worksheet
Dim ToWS As Worksheet
Set FromWS = Sheets("Sheet1")
Set ToWS = Sheets("Sheet2")
Application.EnableEvents = False
Application.ScreenUpdating = False
With Target
If .Address = FromWS.[B3].Address Then
.Copy
With ToWS.[B10]
.PasteSpecial Paste:=xlPasteValues
.PasteSpecial Paste:=xlPasteFormats
End With
Application.CutCopyMode = False
End If
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub

---
Click on the worksheet tab, select View Code, and paste
this into the window.

HTH
Jason
Atlanta, GA


-----Original Message-----
What worksheet function will copy both the content AND

format of a cell in
one worksheet to a cell in another worksheet? I want to

copy both text or
data and the format such as background color or border,

under program
control. This would be a combination of both "="

function and "Format
Painter".
.



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
Better support for dynamic content within headers and footers Anvil Scott Excel Discussion (Misc queries) 1 December 21st 04 08:33 PM
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 1 December 2nd 04 08:30 PM


All times are GMT +1. The time now is 11:22 PM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017