Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Understanding Issues with INTERSECT function in VBA

Good morning.

In an application I'm currently developing, I read two two pieces of data from a list (x,y), then map each x,y pair into a table which has X columns and Y rows.

Everything works fine except I've found that if I don't select the row and column prior to using the intersect function the routine fails with the following error:

Run-time error 13: Type mismatch

My pseudo code looks like:

do for the list of values

find the column in the table corresponding to the X value in the list
set column as rngX
rngX.Select

find the row in the table correcponding to the Y value in the list
set row as rngY
rngY.select

application.Intersect (rngX, rngY) = application.Intersect (rngX, rngY)+1

loop

If I don't include both rngX.Select and rngY.Select commands in exactly the sequence shown the code does not work. Any explanation why?

Art
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Understanding Issues with INTERSECT function in VBA

Showing pseudo code isn't going to cut it here. Give us the real stuff
so we know exactly what it does and the how of it!

As for .Select.., you don't need to select anything to act on it as
long as you have a fully qualified ref to the cell address/index in the
table.

Not knowing the purpose for finding the coordinates, nor why you think
you need to use the Intersect() function, there are more efficient ways
to go about getting a cell index!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
understanding issues with INTERSECT function in VBA [email protected] Excel Programming 0 February 16th 15 06:23 PM
Non-Intersect Function ExcelMonkey Excel Programming 3 May 27th 08 10:18 PM
Intersect Function Problem [email protected] Excel Programming 5 September 20th 06 09:15 PM
Is there any who can help in understanding the VLOOKUP function Ajay Excel Discussion (Misc queries) 1 October 26th 05 08:19 AM
Understanding Checkbox function Lori Burton Charts and Charting in Excel 1 July 25th 05 01:26 PM


All times are GMT +1. The time now is 03:17 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"