ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Syntax for getting value of named workbook range (https://www.excelbanter.com/excel-programming/395265-syntax-getting-value-named-workbook-range.html)

Barb Reinhardt

Syntax for getting value of named workbook range
 
I have a workbook I'm referring to as oWB and a named range in the workbook
called PROGRAM. It is not a worksheet range, but a workbook range. For
the life of me, I can't remember how to get the value of the named range
using VBA. Can someone assist?

Thanks,
Barb Reinhardt

Tom Ogilvy

Syntax for getting value of named workbook range
 
Assuming the named range refers to a single cell:

owb.Names("PROGRAM").RefersToRange.Value

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote:

I have a workbook I'm referring to as oWB and a named range in the workbook
called PROGRAM. It is not a worksheet range, but a workbook range. For
the life of me, I can't remember how to get the value of the named range
using VBA. Can someone assist?

Thanks,
Barb Reinhardt



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

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