ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to refer to the value of a cell containing a VBA function? (https://www.excelbanter.com/excel-programming/356720-how-refer-value-cell-containing-vba-function.html)

Bob at Great Waters

How to refer to the value of a cell containing a VBA function?
 
I have a VBA function in a cell of one worksheet and want to use the value in
a cell of another worksheet. I haven't been able to figure out how to do
that.

Bob

Dave Peterson

How to refer to the value of a cell containing a VBA function?
 
workbooks("book2.xls").worksheets("sheet2").range( "a2").value _
= workbooks("book1.xls").worksheets("sheet1").range( "a1").value

is one way.

if they're in the same workbook:

with workbooks("book1.xls")
.worksheets("sheet2").range("a2").value _
= .worksheets("sheet1").range("a1").value
end with



Bob at Great Waters wrote:

I have a VBA function in a cell of one worksheet and want to use the value in
a cell of another worksheet. I haven't been able to figure out how to do
that.

Bob


--

Dave Peterson


All times are GMT +1. The time now is 09:54 PM.

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