Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,comp.sources.d
external usenet poster
 
Posts: 1
Default Formula for last row and last column on a worksheet

I have been trying the formula for last row and last column on a
worksheet as provided in a previous posting:
http://groups-beta.google.com/group/...c5ef 854b57fd


The formulas a
=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row

=Sheets("Sheet2").Range("IV1").End(xlToLeft).Offse t(0, 1).Column

The former is for finding the last row of a worksheet and the latter is
for finding the last column of a worksheet. Unfortunately, I am
getting an error with these formulas. Any help will be appreciated.

Also, I had a need for formulas that referenced data in another
spread-sheet in the Excel-specified format i.e.
='<directory-name\[<file-name]<sheet-name'!<cell-name

For example,
='C:\My Documents\Spread-sheets\[Info04-01-09.xls]MainSheet'!F15


Here is what I did. I first stored all the excel files in the
directory (.xls extension) in a file. Then I created a UNIX
shell-script that read the file names and converted them into the
formulas. This was certainly a lot of pain, but it worked like a
charm. I want to now know how I could achieve this using Excel macros.
Thanks,
Nimmi

  #2   Report Post  
Posted to microsoft.public.excel.programming,comp.sources.d
external usenet poster
 
Posts: 27,285
Default Formula for last row and last column on a worksheet

The formulas a
=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row

=Sheets("Sheet2").Range("IV1").End(xlToLeft).Offs et(0, 1).Column


Those are not formulas, they are VBA statements.

Check out the worksheet.functions news group if you want formulas.

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
I have been trying the formula for last row and last column on a
worksheet as provided in a previous posting:

http://groups-beta.google.com/group/...c5ef 854b57fd


The formulas a
=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row

=Sheets("Sheet2").Range("IV1").End(xlToLeft).Offse t(0, 1).Column

The former is for finding the last row of a worksheet and the latter is
for finding the last column of a worksheet. Unfortunately, I am
getting an error with these formulas. Any help will be appreciated.

Also, I had a need for formulas that referenced data in another
spread-sheet in the Excel-specified format i.e.
='<directory-name\[<file-name]<sheet-name'!<cell-name

For example,
='C:\My Documents\Spread-sheets\[Info04-01-09.xls]MainSheet'!F15


Here is what I did. I first stored all the excel files in the
directory (.xls extension) in a file. Then I created a UNIX
shell-script that read the file names and converted them into the
formulas. This was certainly a lot of pain, but it worked like a
charm. I want to now know how I could achieve this using Excel macros.
Thanks,
Nimmi



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
copy a formula within a row from a column on another worksheet jc Excel Worksheet Functions 4 January 30th 07 11:54 PM
Looking up a variable in one worksheet and copying information from another column to another worksheet?? Brad Torken Excel Discussion (Misc queries) 2 December 10th 06 06:02 AM
FIND A TEXT IN A WORKSHEET NOT IN A COLUMN OR ROW BY FORMULA peyman Excel Discussion (Misc queries) 1 August 24th 06 03:57 PM
Formula that uses Last Number in Column of another worksheet Gladys Excel Discussion (Misc queries) 3 August 17th 06 08:02 PM
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet Aster Excel Worksheet Functions 3 March 12th 06 09:58 AM


All times are GMT +1. The time now is 12:40 PM.

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"