ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cell values as label captions (https://www.excelbanter.com/excel-programming/345306-cell-values-label-captions.html)

Rbp9ad[_2_]

cell values as label captions
 
In a userform I want to display cell values in a label. This code gives me a
subscript out of range.

label1.caption = workbooks("myworkbook.xls") .worksheets(1).range("a1)



Tom Ogilvy

cell values as label captions
 
label1.caption = workbooks("myworkbook.xls")
..worksheets(1).range("a1").Value

If it still gives you that error message, you don't have a workbook open
named Myworkbook.xls

--
Regards,
Tom Ogilvy


"Rbp9ad" wrote in message
...
In a userform I want to display cell values in a label. This code gives me

a
subscript out of range.

label1.caption = workbooks("myworkbook.xls") .worksheets(1).range("a1)






All times are GMT +1. The time now is 02:59 AM.

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