Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-27-2014, 06:14 AM
tinfanide tinfanide is offline Intersect Windows 7 64bit Intersect Office 2010 32bit
Expert
Intersect
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Code:
Sub test()  
If intersect(ActiveCell, Range("A:A,C:C")) Is Nothing Then     
MsgBox "not intersect" 
Else     
MsgBox "intersect" 
End If  End Sub  

Sub test2()  

Dim colA As ListColumn, colC As ListColumn
'''
Set colA = ListObjects("Table1").ListColumns("a").Range 
Set colC = ListObjects("Table1").ListColumns("c").Range 
'''
Dim rng As Range
Set rng = Union(colA,colC)

If intersect(ActiveCell, rng) Is Nothing Then     
MsgBox "not intersect" 
Else     
MsgBox "intersect" 
End If  
End Sub
I've found out that with the use of "Union()" function, Column A and Column C will be treated seperately whilst otherwise, it will be treated like from Column A to Column C (i.e. including Column B).
Reply With Quote
 



Other Forums: Access Forums

All times are GMT -7. The time now is 12:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft