Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Place a date in another cell only if adjacent cell = "X"
How do I modify this code to place a date in the adjacent cell only if that
cell equals a capital x? Private Sub Worksheet_Change(ByVal Target As Excel.Range) With Target If .Count 1 Then Exit Sub If Not Intersect(Range("c2:c50000"), .Cells) Is Nothing Then Application.EnableEvents = False If IsEmpty(.Value) Then .Offset(0, 1).ClearContents Else With .Offset(0, 1) .NumberFormat = "mm/dd/yyyy" .Value = Date End With End If Application.EnableEvents = True End If End With End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Place a date in another cell only if adjacent cell = "X"
You have an answer in your other thread
"JOSEPH WEBER" wrote: How do I modify this code to place a date in the adjacent cell only if that cell equals a capital x? Private Sub Worksheet_Change(ByVal Target As Excel.Range) With Target If .Count 1 Then Exit Sub If Not Intersect(Range("c2:c50000"), .Cells) Is Nothing Then Application.EnableEvents = False If IsEmpty(.Value) Then .Offset(0, 1).ClearContents Else With .Offset(0, 1) .NumberFormat = "mm/dd/yyyy" .Value = Date End With End If Application.EnableEvents = True End If End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding data only if adjacent to cell labeled "male"/"female" | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
"IF" function, have the facility to place a colour in the cell | Excel Worksheet Functions | |||
Find all cells with "A" and add the values of the adjacent cell to give a total. | Excel Programming | |||
Excel: can "go to adjacent empty cell" double-click be disabled? | Excel Discussion (Misc queries) |