There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
VBA detecting data in a range


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
cjsmith22's Avatar
Member with 49 posts.
 
Join Date: Sep 2003
03-Nov-2005, 08:45 AM #1
VBA detecting data in a range
this will probably be completely obvious to some of you but being a bit thick its got me stumped. i have a workbook which contains the results and a table for the current premier football league.i have two ranges in the worksheet (myresults and mytable). What needs to happen is the table needs to update depending on the results that particular week.

the thing that i cant get my head around is this - "the macro should be able to run successfully for any number of teams in the league and any number of matches played. both of these should be detected from the data. you may assume that the spelling of teams names in the results section corresponds exactly to the spelling used in the league table - bearing in mind that a teams name can appear twice in a set of results"

so how do i get my macro to detect, for example whats in cell b2 of the myresults range, eg.tottenham, and get it to correspond with where tottenham may happen to be in the mytable range?

if that made the slightest bit of sense at all, thanks in advance

chris
Attached Files
File Type: zip Table.zip (8.5 KB, 10 views)
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,370 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
04-Nov-2005, 05:58 AM #2
This sounds a bit like a training exercise.
See this thread for how to loop through a range looking for data.
http://forums.techguy.org/t413548.html
You will actually need 2 loops, one within the called (called nested loops).
The first loop goes through your myresults and the second loop goes through the league table looking for the name that matches your cell value in myresults.
__________________
.
.
OBP
I do not give up easily
cjsmith22's Avatar
Member with 49 posts.
 
Join Date: Sep 2003
04-Nov-2005, 08:19 AM #3
cheers OGP
cjsmith22's Avatar
Member with 49 posts.
 
Join Date: Sep 2003
04-Nov-2005, 08:20 AM #4
sorry! obp
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:36 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.