Macro Help Pleaseee...

bulldaddy1

New Member
Joined
Aug 25, 2009
Messages
39
Good morning!

Can anyone please help me with a Macro that will format a border (one single dark line on the bottom of each cell) everytime there is a change in the cell value.

Thank you very much for your help!
 
Two parts to this I think

Part 1, on activating your sheet, copies the data in col A to col H.

Private Sub Worksheet_Activate()
Columns("A:A").Copy
Columns("H:H").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub

Part 2 assumes that you have a sum() formula totalling the contents of col A.

And it will compare the cells in range a1:a10 to the cells in col H, and underline any that are different.



Private Sub Worksheet_Calculate()
Dim c As Range, rng
Set rng = Range("a1:a10")
For Each c In rng
If c.Value <> c.Offset(0, 7) Then
c.Borders(xlEdgeBottom).LineStyle = xlContinuous
End If
Next c
End Sub
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,224,551
Messages
6,179,476
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top