Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nancy
 
Posts: n/a
Default How do I dynamically retrieve the cell address of the last cell t.

I want to write to an excel file that already has data in it using matlab
xlswrite function. I found that I can write to the excel file without
overwriting information that is already there. So I was wondering if there
is a way in excel to retrieve the address or index of the last cell
containing data.
  #2   Report Post  
Otto Moehrbach
 
Posts: n/a
Default

Nancy
There are several ways of doing this depending on the layout of your
data.
Say you have data in all the cells of A1:A10. No blank cells in that
range. You can use:
LastCellAddress = Range("A1").End(xlDown).Address(0,0)
This will give the address of A10.

If you have blank cells in your data and you want to find the address of the
last occupied cell, use:
LastCellAddress = Range("A" & Rows.Count).End(xlUp).Address(0,0)
HTH Otto
"Nancy" wrote in message
...
I want to write to an excel file that already has data in it using matlab
xlswrite function. I found that I can write to the excel file without
overwriting information that is already there. So I was wondering if
there
is a way in excel to retrieve the address or index of the last cell
containing data.



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
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
How do I get one cell to record the time another cell was changed. Reigning in Seattle Excel Discussion (Misc queries) 1 December 17th 04 07:45 PM
Change Axes Scale Dynamically Fysh Charts and Charting in Excel 3 December 16th 04 02:57 PM
Display actual contents of cell xmasbob Excel Discussion (Misc queries) 1 December 6th 04 05:09 PM
copy a cell value not its function KC Mao Excel Discussion (Misc queries) 2 December 4th 04 04:30 AM


All times are GMT +1. The time now is 12:02 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"