ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get value of last cell in column A from a closed workbook (https://www.excelbanter.com/excel-programming/310379-get-value-last-cell-column-closed-workbook.html)

Jon Atkins

Get value of last cell in column A from a closed workbook
 
Hi

I have a Userform set up on a workbook called ISSUE.xls the closed
workbook is called REGISTER.xls

How can I get the value of the last cell in column A from a closed
workbook and then place that value into a Textbox on the Userform?

Thanks.

Bob Kilmer

Get value of last cell in column A from a closed workbook
 
Open the workbook, read the value, close it. You do not have to show it, but
you have to open it to read it.

"Jon Atkins" wrote in message
...
Hi

I have a Userform set up on a workbook called ISSUE.xls the closed
workbook is called REGISTER.xls

How can I get the value of the last cell in column A from a closed
workbook and then place that value into a Textbox on the Userform?

Thanks.




Dave Peterson[_3_]

Get value of last cell in column A from a closed workbook
 
I'd use a cell in a worksheet (hidden??) or just out of the way:

=LOOKUP(2,1/('C:\My Documents\excel\[register.xls]Sheet1'!$A$1:$A$9999<""),
'C:\My Documents\excel\[register.xls]Sheet1'!$A$1:$A$9999)
(all one cell)

Then populate the textbox from that cell.

(change 9999 to a big number, but don't use the whole column)

Jon Atkins wrote:

Hi

I have a Userform set up on a workbook called ISSUE.xls the closed
workbook is called REGISTER.xls

How can I get the value of the last cell in column A from a closed
workbook and then place that value into a Textbox on the Userform?

Thanks.


--

Dave Peterson


Jon Atkins

Get value of last cell in column A from a closed workbook
 
On Sat, 18 Sep 2004 07:05:45 -0500, Dave Peterson
wrote:

I'd use a cell in a worksheet (hidden??) or just out of the way:

=LOOKUP(2,1/('C:\My Documents\excel\[register.xls]Sheet1'!$A$1:$A$9999<""),
'C:\My Documents\excel\[register.xls]Sheet1'!$A$1:$A$9999)
(all one cell)

Then populate the textbox from that cell.

(change 9999 to a big number, but don't use the whole column)


That did the trick
I had hacked and slashed at some of Ron de Bruin's code, but your
method has tidied up a mess and reduced the file size.

Many thanks to both you and Bob kilmer for replying


All times are GMT +1. The time now is 11:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com