View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Copy format automatically from other cell

Copy this to wroksheet code:

Dim b As Boolean
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim r1 As Range
Dim r2 As Range

Set r1 = Range("A:A")
Set r2 = Range("B1")

If Intersect(Target, r1) Is Nothing Then
If b = True Then
Application.EnableEvents = False
r1.Copy
r2.PasteSpecial Paste:=xlPasteFormats
b = False
Target.Select
Application.EnableEvents = True
End If
Else
b = True
End If
End Sub

If you select a cell in column A and change its format, the formats of
column B will automatically pick up the A formats once a cell outside of
column A has been selected.
--
Gary''s Student


"מיכל" wrote:

hello,

I neet to create an automatically foramting for one column according to
anoter colomn formating.

I want the cell formating to change in one colomn whenever the formating it
changing in another colomn.

how can I do it ?
(I know how to use conditinal formating but I didnt find it helpful in that
case)

thank you.
Michal