Picking up Excel Named Variables

When defining a name within an Excel spreadsheet, you can pick it up using VBA as follows:

[vb]ActiveWorkbook.Names(“your defined variable name”).Value[/vb]

 

or set a named variable:

[vb]ActiveWorkbook.Names.Add Name:=”bob”, RefersToR1C1:=”=Sheet1!R5C21:R8C21″
ActiveWorkbook.Names(“bob”).Comment = “”[/vb]