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

  • Thread starter Thread starter Jon Atkins
  • Start date Start date
J

Jon Atkins

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.
 
Open the workbook, read the value, close it. You do not have to show it, but
you have to open it to read it.
 
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)
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top