ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do i refer to cell contents in a macro? (https://www.excelbanter.com/excel-programming/438579-how-do-i-refer-cell-contents-macro.html)

Rob

How do i refer to cell contents in a macro?
 
I am a novice and i am trying to write a macro to position the sheet at a cell.
The cell reference that i want to go to is a variable which is the
calculated content of another cell (CELL 2). How do i insert the CONTENTS of
cell 2 (address I want to go to: i.e. R45) into the macro so it works
properly?

Gary''s Student

How do i refer to cell contents in a macro?
 
Lets say A1 contains the formula
="Z" & ROW()*100

A1 displays:
Z100

Then:

Sub GoThere()
Application.Goto reference:=Range(Range("A1").Value)
End Sub

--
Gary''s Student - gsnu200909


"Rob" wrote:

I am a novice and i am trying to write a macro to position the sheet at a cell.
The cell reference that i want to go to is a variable which is the
calculated content of another cell (CELL 2). How do i insert the CONTENTS of
cell 2 (address I want to go to: i.e. R45) into the macro so it works
properly?



All times are GMT +1. The time now is 04:20 PM.

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