Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Really appreciate your site. Really good site for learning what others do when they run into problems. You guy's are great!!!..."

Geography

Where in the world do Tek-Tips members come from?

Creating an Excel Workbook my sources are an access query and multiple workbooks

RodgerDJr (MIS)
27 Jun 12 16:23
All,

I have created a database to track our projects. Each project could be a stand alone project or a child of a parent project. Each project can have many task to track those I have an excel workbook with one sheet for each project. I would like to take all the children task list and roll them into one workbook.

I have been butchering the code I know, I was just trying to get it to work or at least my concept.

Here is my thought process

I need two instances of Excel right?

xlAppMain – New Workbook
xlAppPro - Individual Projects want to copy what is here to the New Workbook.

I know the first cell I want is A2, and the last row I want is H(x).

Well I tried to use:
z = xlAppPro.Worksheets(1).UsedRange.Rows.Count

Well when I created my Template that has created all the Task List in xls I forgot I had some text on row 4000, so unless I want to go through and delete that from some 100 excel sheets I need to look at another option. Even if I do this I have some rows off to the right at least 8. So task may only be 2 or 3 rows.

So I tried this:
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With


For some reason I get row 1 even thought there is data in say A18.

So I went back to an old school method I came up with:

Range("A16384").Select
Selection.End(xlUp).Select
x = ActiveCell.Row


Any ideas?

TIA,
Rodger
SkipVought (Programmer)
27 Jun 12 16:36
hi,

Quote:

I have an excel workbook with one sheet for each project
OUCH! Not a sound design, INHO!

Why are you using Excel? Why not store it all in Access?

If you are using Excel, you do not want separate instances of the Excel application. You are already making it more difficult than it needs to be by using "one sheet for each project", and hiding one workbook from another??? For what reason?

Think yer off on the wrong foot, heading in the wrong direction.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

PHV (MIS)
27 Jun 12 18:23
What about this ?
z = xlAppPro.Worksheets(1).Range("A2").CurrentRegion.Rows.Count

Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close