Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding the last row in a sheet in a closed workbook.


I know there is a way to find the last used row in a spreadsheet, but
I'd like to know if there is any way to determine the last row used in
a range in a spreadsheet in a closed workbook.


--
peterv
------------------------------------------------------------------------
peterv's Profile: http://www.excelforum.com/member.php...o&userid=25572
View this thread: http://www.excelforum.com/showthread...hreadid=393787

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Finding the last row in a sheet in a closed workbook.

Depends on what the data looks like, but if there will be no blanks inside a
column of data

=countA(C:\myfolder\[Myfiler.xls]Sheet1!$A:$A)


would be something to try. Put this formula in a cell, then check the
returned value and remove the formula.

--
Regards,
Tom Ogilvy

"peterv" wrote in
message ...

I know there is a way to find the last used row in a spreadsheet, but
I'd like to know if there is any way to determine the last row used in
a range in a spreadsheet in a closed workbook.


--
peterv
------------------------------------------------------------------------
peterv's Profile:

http://www.excelforum.com/member.php...o&userid=25572
View this thread: http://www.excelforum.com/showthread...hreadid=393787



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default Finding the last row in a sheet in a closed workbook.

Hi Peter,

You have to open it to find out. You can do it invisibly for the user
by using application.ScreenUpdating = false before opening.

Regards
Jean-Yves

"peterv" wrote in
message ...

I know there is a way to find the last used row in a spreadsheet, but
I'd like to know if there is any way to determine the last row used in
a range in a spreadsheet in a closed workbook.


--
peterv
------------------------------------------------------------------------
peterv's Profile:

http://www.excelforum.com/member.php...o&userid=25572
View this thread: http://www.excelforum.com/showthread...hreadid=393787



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding the last row in a sheet in a closed workbook.


Tom, your suggestion works, if I'm doing it from within anothe
worksheet. What I forgot to mention (the original post was around 3am
is that I'm trying to do this in a VBA procedure. Do you, or doe
anyone know how to execute a worksheet function from within vba?
Thanks for your idea Tom.

Jean-Yves, I haven't tried your idea yet, but I'm about to

--
peter
-----------------------------------------------------------------------
peterv's Profile: http://www.excelforum.com/member.php...fo&userid=2557
View this thread: http://www.excelforum.com/showthread.php?threadid=39378

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Finding the last row in a sheet in a closed workbook.

The easiest and fastest is to just do the same in a worksheet cell (just
using activecell as an example)

Activecell.Formula = "=countA(C:\myfolder\[Myfiler.xls]Sheet1!$A:$A)"
lastrow = ActiveCell.Value
ActiveCell.clearcontents

--
Regards,
Tom Ogilvy


"peterv" wrote in
message ...

Tom, your suggestion works, if I'm doing it from within another
worksheet. What I forgot to mention (the original post was around 3am)
is that I'm trying to do this in a VBA procedure. Do you, or does
anyone know how to execute a worksheet function from within vba?
Thanks for your idea Tom.

Jean-Yves, I haven't tried your idea yet, but I'm about to.


--
peterv
------------------------------------------------------------------------
peterv's Profile:

http://www.excelforum.com/member.php...o&userid=25572
View this thread: http://www.excelforum.com/showthread...hreadid=393787



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
Moving Sheet to Closed Workbook Roger Excel Discussion (Misc queries) 0 January 13th 08 05:16 PM
Help...Code to copy sheet from closed workbook [email protected] Excel Discussion (Misc queries) 1 March 28th 07 08:52 PM
Consolidation of data from cell in active sheet of closed workbook Neil X Peel Excel Worksheet Functions 3 March 8th 07 02:35 PM
Import Sheet from Closed Workbook Joe Derr[_2_] Excel Programming 1 May 2nd 05 09:07 AM
Return Sheet Names from Closed Workbook crispbd[_38_] Excel Programming 1 November 24th 04 05:46 PM


All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"