Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi guys, I don't think I explained very cleary what I am trying to achieve. I would like a range of values in column C to match the corresponing value in Column D when the user enters a Value in a cell in Column D. I can do it with one cell, for example If Target.Address < "$D$13" Then Exit Sub [c13].Value = Target but how to you expand this to all of columns D & C ? Thanks, Michael Michael, Try Private Sub Worksheet_Change(ByVal Target As Excel.Range) Application.EnableEvents = False On Error GoTo ws_exit If Not Intersect(Target, Range("$D$13:E100")) Is Nothing Then With Target.Offset(0, -1) With .Interior .ColorIndex = 35 .Pattern = xlSolid End With .Font.Bold = True End With End If ws_exit: Application.EnableEvents = True End Sub -- HTH Bob Phillips "Michael" wrote in message ... Hi all, Is it possible to expand the code below to apply it a range of cells. At present it only works on a single cell D13 and consequently C13.Is this possible?, Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Address < "$D$13" Then Exit Sub [c13].Value = Target Range("C13").Select With Selection.Interior .ColorIndex = 35 .Pattern = xlSolid End With Selection.Font.Bold = True End Sub Thanks for your help Michael .. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet Consolidation - Repost requested | Excel Discussion (Misc queries) | |||
Repost -calculate % change for each phrase. | Excel Worksheet Functions | |||
Worksheet Change Method | Excel Programming | |||
Worksheet Change Method | Excel Programming | |||
Worksheet Change Method | Excel Programming |