ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   reference range in other sheet (https://www.excelbanter.com/excel-discussion-misc-queries/98857-reference-range-other-sheet.html)

Diana

reference range in other sheet
 
I would like to write a macro reference range. I have two sheets in the same
workbook (sheet1 and sheet2). I know when you are trying to reference a cell
in a different sheet you refer to sheet and cell (='Sheet2'!D1) but I am
trying to reference range D1:D4 on sheet 2. Is there a way to do this?

Many thanks
Diana



Gary''s Student

reference range in other sheet
 
Dim r as range
set r=Worksheets("Sheet2").Range("D1:D4")
--
Gary's Student


"Diana" wrote:

I would like to write a macro reference range. I have two sheets in the same
workbook (sheet1 and sheet2). I know when you are trying to reference a cell
in a different sheet you refer to sheet and cell (='Sheet2'!D1) but I am
trying to reference range D1:D4 on sheet 2. Is there a way to do this?

Many thanks
Diana




All times are GMT +1. The time now is 12:24 AM.

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