Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Syntax problem with" intersect"

Hello All, I hope someone is still active despite the weekend...

I get a error message " The argument is not "free of choice" (or what it
will be like in an english version) and the .Intersect. command highlighted.
(sorry about the double "not" in sentence "Not .. Is Nothing...)

Here is a extract of the code:

Private Sub Worksheet_Change(ByVal Target As Range)
....
ActRow = Target.Row
ActCol = Target.Column
If Not ActiveSheet.Intersect.Range("A6:A25, A29:A48, A52:A94") Is
Nothing Then ' HERE !!!
If Application.Range(Cells(ActRow, ActCol)).Value = "" Then
If Application.Range(Cells(ActRow, ActCol + 1)).Value = "" Then
End If
If Application.Range(Cells(ActRow, ActCol + 1)).Value < "" Then
MsgBox "DuhmDiduhm DaDiDo"
End If
End If
If Not Application.Intersect.Range("B6:B25, B29:B48, B52:B94") Is
Nothing Then
If Application.Range(Cells(ActRow, ActCol)).Value = "" Then
If Application.Range(Cells(ActRow, ActCol - 1)).Value = "" Then
End If
If Application.Range(Cells(ActRow, ActCol - 1)).Value < "" Then
Application.Range(Cells(ActRow, ActCol - 1)).Value = 0
End If

Any suggestions? What is wrong with Intersect syntax?

/regards


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Syntax problem with" intersect"

Hi
this looks like a wrong syntac. I assume you want to test if the
changed range target is within A1:A25, A29:A48 or A52:A94

try something like the following:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim test_range
set
test_range=union(me.range("A1:A25"),me.range("A29: A45"),me.range("A52:A
94"))
if not intersect(target,test_range) is nothing then
'now your code
end sub


--
Regards
Frank Kabel
Frankfurt, Germany


Imbecill wrote:
Hello All, I hope someone is still active despite the weekend...

I get a error message " The argument is not "free of choice" (or what
it will be like in an english version) and the .Intersect. command
highlighted. (sorry about the double "not" in sentence "Not .. Is
Nothing...)

Here is a extract of the code:

Private Sub Worksheet_Change(ByVal Target As Range)
...
ActRow = Target.Row
ActCol = Target.Column
If Not ActiveSheet.Intersect.Range("A6:A25, A29:A48, A52:A94") Is
Nothing Then ' HERE !!!
If Application.Range(Cells(ActRow, ActCol)).Value = "" Then
If Application.Range(Cells(ActRow, ActCol + 1)).Value =
"" Then End If
If Application.Range(Cells(ActRow, ActCol + 1)).Value <
"" Then MsgBox "DuhmDiduhm DaDiDo"
End If
End If
If Not Application.Intersect.Range("B6:B25, B29:B48, B52:B94") Is
Nothing Then
If Application.Range(Cells(ActRow, ActCol)).Value = "" Then
If Application.Range(Cells(ActRow, ActCol - 1)).Value =
"" Then End If
If Application.Range(Cells(ActRow, ActCol - 1)).Value <
"" Then Application.Range(Cells(ActRow, ActCol -
1)).Value = 0 End If

Any suggestions? What is wrong with Intersect syntax?

/regards


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Syntax problem with" intersect"

If Not Intersect(Target,me.Range("A6:A25, A29:A48, A52:A94")) Is _
Nothing Then

If Not Intersect(Target,Range("B6:B25, B29:B48, B52:B94")) Is _
Nothing Then


--
Regards,
Tom Ogilvy

"Imbecill" wrote in message
...
Hello All, I hope someone is still active despite the weekend...

I get a error message " The argument is not "free of choice" (or what it
will be like in an english version) and the .Intersect. command

highlighted.
(sorry about the double "not" in sentence "Not .. Is Nothing...)

Here is a extract of the code:

Private Sub Worksheet_Change(ByVal Target As Range)
...
ActRow = Target.Row
ActCol = Target.Column
If Not ActiveSheet.Intersect.Range("A6:A25, A29:A48, A52:A94") Is
Nothing Then ' HERE !!!
If Application.Range(Cells(ActRow, ActCol)).Value = "" Then
If Application.Range(Cells(ActRow, ActCol + 1)).Value = ""

Then
End If
If Application.Range(Cells(ActRow, ActCol + 1)).Value < ""

Then
MsgBox "DuhmDiduhm DaDiDo"
End If
End If
If Not Application.Intersect.Range("B6:B25, B29:B48, B52:B94") Is
Nothing Then
If Application.Range(Cells(ActRow, ActCol)).Value = "" Then
If Application.Range(Cells(ActRow, ActCol - 1)).Value = ""

Then
End If
If Application.Range(Cells(ActRow, ActCol - 1)).Value < ""

Then
Application.Range(Cells(ActRow, ActCol - 1)).Value = 0
End If

Any suggestions? What is wrong with Intersect syntax?

/regards




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
correct syntax for nesting "if", "and", and "vlookup"....if possib Christine Excel Worksheet Functions 4 January 2nd 09 10:43 PM
Syntax to "OR" 3 "ISERROR" conditions Mike K Excel Worksheet Functions 6 July 22nd 06 04:18 PM
disregard 12/19/05 ".XValues syntax problem" question. Answer fou JF_01 Charts and Charting in Excel 1 December 19th 05 08:22 PM
what is syntax for if(between range of dates,"Q1","Q2")? TLB Excel Worksheet Functions 3 December 6th 05 05:19 PM


All times are GMT +1. The time now is 04:48 AM.

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"