ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   using named ranges in macros (https://www.excelbanter.com/excel-discussion-misc-queries/120810-using-named-ranges-macros.html)

Dave F

using named ranges in macros
 
I have the following macro code which I recorded with the macro recorder:

Sub TCAPSfcst()
' Hides rows 85:120
' Hides columns AM:CP
' Freezes window at J4
Cells.Select
Range("B1").Activate
Selection.EntireRow.Hidden = False
Selection.EntireColumn.Hidden = False
Rows("85:120").Select
Selection.EntireRow.Hidden = True
Columns("AM:CP").Select
Selection.EntireColumn.Hidden = True
Range("J4").Select
ActiveWindow.FreezePanes = False
ActiveWindow.FreezePanes = True

I need to change the cell/range references in this code to named ranges.
What is the syntax for named ranges in VBA? I've already created the named
ranges.

Thanks,

Dave

--
Brevity is the soul of wit.


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

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