ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   use of indirect function in vba (https://www.excelbanter.com/excel-programming/352162-use-indirect-function-vba.html)

R..VENKATARAMAN

use of indirect function in vba
 
indirect function is not one of the worksheet functions available in vba.
but
the code
Range("E8").Select

ActiveCell.FormulaR1C1 = "=INDIRECT(R[-7]C[-4])"
Range("E8").Select
(this is based on a macro created on going through the steps)
works . But

activecell=indirect(range("a1")) does not work
nor
activecell=application.indirect(range("a1"))
nor
activecell.formula="application.indirect(range("a1 ")"

any comments or any of my codes wrong. ??




Executor

use of indirect function in vba
 
Hi,

Try:

Sub myIndirect()
Range("E8").Select
ActiveCell.Value = Range(Range("A1").Value).Value
End Sub

Hoop this helps,


Executor


R..VENKATARAMAN

use of indirect function in vba
 
thank you. that helps.


"Executor" wrote in message
oups.com...
Hi,

Try:

Sub myIndirect()
Range("E8").Select
ActiveCell.Value = Range(Range("A1").Value).Value
End Sub

Hoop this helps,


Executor





All times are GMT +1. The time now is 12:18 PM.

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