Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Target line to a column chart? Deb Charts and Charting in Excel 2 September 14th 07 12:50 PM
Target cell reference moves when target is cut and pasted Illya Teideman Excel Discussion (Misc queries) 5 May 31st 07 11:34 AM
Ranges:Target in Worksheet_SelectionChange(ByVal Target As Range) Kevin McCartney Excel Programming 3 April 15th 05 01:51 PM
How find if target is object in Worksheet_Change (ByVal Target As.. ?) Gunnar Johansson Excel Programming 3 July 1st 04 09:25 PM
Help please assigning column and rows HS[_3_] Excel Programming 0 October 6th 03 10:07 PM


All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"