Copy format automatically from other cell

G

Guest

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top