That got it!
Main Topics
Browse All TopicsHello -
I am trying to run a routine that reads a group of cells on a worksheet. The procedure is being run from within an Access database, but I am working with Excel objects. What I want to do is read the value of a cell, then move focus to the cell directly below that one, and get the value of that. I want to repeat the sequence until the cell being read has a value of "OVERALL PerFORMANCE".
I am trying to move to the next cell using a range.offset(1,0) command. It's not working though. I just keep reading the value of the 1st cell. I've simplified to code to illustrate what is happening.
I need to extract this information from a couple hundred workbooks, so it is important to me that I get this automation working.
What must I do to read the cells working down from the first?
Thanks,
Todd
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You're welcome...thanks for the points and the grade! I'm glad it worked.
Question: Do you need Excel to open and become visible? If not then this code could be made a lot more effecient pretty easily...let me know and I'll do that for you tomorrow if you don't need Excel to be visible...I expect to be bored...lol
:-)
Albert
I went ahead and wrote my own version that got rid of all the selecting of sheets and cells, but not knowing what you really are trying to accomplish, I don't know how to customize it. Don't get me wrong...Your code is very well written. I can tell you defineately know what you are doing. It is a good job!
It's just that searching cells without selecting each one is much better that selecting each one, but the more I think about it, the more I think maybe you want Excel to be visible, but there is still no reason to select each cell to search it...just keep setting rngdata to the next cell and read it's value, but don't select it each time and your code will run much faster.
If you just need to change or retrieve a value or something from your excel sheet, then there is probably no reason to make Excel visible either. You could change it with code or view it with a message box or whatever...But if you need the code to stop so you can actually see the sheet, then that's another story, you will need it to be visible, but you will still only need to select the 1 cell you want, not each one as you go.
Anyway, I'm not dissing your code. It's very well written!
:-)
Albert
Business Accounts
Answer for Membership
by: ahammarPosted on 2009-10-15 at 18:01:39ID: 25586251
Add a line between 210 and 220 that says this:
Set rngData = Activecell
So you end up with the following..
See if that fixes your problem...
:-)
Albert
Select allOpen in new window