Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
assigning formula to a target column
When I have only one target column it's working well:
If (Target.Column < 8) Then Exit Sub If Target.Cells.Count 8 Then Exit Sub Application.EnableEvents = False With Target(1, 3) If Target.Value < "" Then .NumberFormat = "mmm-yy" .FormulaR1C1 = "=RC[-2]" Else .ClearContents End If End With With Target(1, 4) If Target.Value < "" Then ... End With But, when I'm trying to use one more (the first) target column it's not working: If (Target.Column < 8) Or (Target.Column < 1) Then Exit Sub 'here it goes to exit If Target.Cells.Count 8 Then Exit Sub ' don't know how to handle with this as well Application.EnableEvents = False .... How could I do it? Thanks 'If Target.Column = 8 Then |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
assigning formula to a target column
If Target.Columns.count 1 then exit sub
If Target.Column < 8 and Target.Column < 1 then exit sub After that, there should be no difference -- Regards, Tom Ogilvy "Alex" wrote in message ... When I have only one target column it's working well: If (Target.Column < 8) Then Exit Sub If Target.Cells.Count 8 Then Exit Sub Application.EnableEvents = False With Target(1, 3) If Target.Value < "" Then .NumberFormat = "mmm-yy" .FormulaR1C1 = "=RC[-2]" Else .ClearContents End If End With With Target(1, 4) If Target.Value < "" Then ... End With But, when I'm trying to use one more (the first) target column it's not working: If (Target.Column < 8) Or (Target.Column < 1) Then Exit Sub 'here it goes to exit If Target.Cells.Count 8 Then Exit Sub ' don't know how to handle with this as well Application.EnableEvents = False ... How could I do it? Thanks 'If Target.Column = 8 Then |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Target line to a column chart? | Charts and Charting in Excel | |||
Target cell reference moves when target is cut and pasted | Excel Discussion (Misc queries) | |||
Ranges:Target in Worksheet_SelectionChange(ByVal Target As Range) | Excel Programming | |||
How find if target is object in Worksheet_Change (ByVal Target As.. ?) | Excel Programming | |||
Help please assigning column and rows | Excel Programming |