{"id":4103,"date":"2024-02-02T18:56:35","date_gmt":"2024-02-02T18:56:35","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/wp\/?p=4103"},"modified":"2024-02-02T18:56:35","modified_gmt":"2024-02-02T18:56:35","slug":"refer-name-range-values-excel-macro","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2024\/02\/refer-name-range-values-excel-macro\/","title":{"rendered":"How to refer Values from a Named Range – Excel VBA"},"content":{"rendered":"
Dear Readers,<\/p>\n
I am writing this new article about How can you read values stored in a Name range in Excel Sheet in Excel Macro<\/i><\/strong> . For the readers who are unaware or need more information about the Name Range<\/strong>, I would suggest you to first go through the below mentioned article before jumping up to this article. In this article we will discuss on reading values stored in a Name range in Excel Sheet using Excel VBA. Name ranging in excel sheet means giving a name to a Range to refer it by the name given. Name can be given to a single cell or a range cells. So let’s see how can we access a name range in VBA.\n<\/p>\n You can refer a name range in VBA code like below: Range(“<range name>”)<\/i><\/p>\n <\/strong><\/p>\n Above statement returns a 2 dimensional array which is holding all the values in the named range in (x, y) format where x = Row, y= Column.<\/p>\n Note: If named range is having only one cell then Range(“<range name>”) will return that one value. No need to put it in (x ,y) format.<\/i><\/p>\n Name Range with single cell can result only one value therefore Range(“<range name>”)<\/i> will return the value of that single cell.<\/p>\n
\n Click on this link<\/a> to get to know more about \u201cName Range in Excel\u201d.<\/p>\nSyntax:<\/h2>\n
\n<\/p>\nExamples:<\/h2>\n
1. Named Range with a Single Cell <\/h3>\n