ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   refer to cell (https://www.excelbanter.com/excel-programming/389905-re-refer-cell.html)

[email protected]

refer to cell
 
Hi
for variable ranges it is simpler to do
Range("A1").Resize(x,x).Name = "CorrMatrix"

regards
Paul

On May 23, 9:13 am, Arne Hegefors
wrote:
Hi! I want to name a range in VBA. I know in what cell I want it to start,
lets say A1. I also have a variable that controls both the height and length
of the range (they are of equal size). This variable is called x.

I have:

ThisWorkbook.Names.Add Name:="CorrMatrix", RefersTo:="=$A$1:$C$10",
Visible:=True

but the Refers to bit is wrong. How shall I write it? please help!





All times are GMT +1. The time now is 05:29 PM.

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