View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Luc[_8_] Luc[_8_] is offline
external usenet poster
 
Posts: 13
Default Selecting a named range, the name of the named range is in a cell

Thanxxxxx

Luc

"Gary Keramidas" <GKeramidasAtMSN.com schreef in bericht
...
this may or may not be what you want:

Sub test()
Dim ws As Worksheet
Set ws = Worksheets("Master")
Dim rangeToSelect As String
rangeToSelect = ws.Range("extraRisk").Value
ws.Range(rangeToSelect).Select
End Sub

--


Gary Keramidas
Excel 2003


"Luc" wrote in message
...
What i want to do is the following :

I have a cell which i have named "ExtraRisk".
This cell contains text : example "Electricity", which is also the name
of a range.
Now i want to select this named range "Electricity" & copy the range

How do i do this.

What i have so far is :


Sub Risicos_toevoegen()

....
Sheets("MASTER").Select

'I'm stuck here....
Application.Goto Reference:="ExtraRisk" 'I do not want to copy the
named range "ExtraRisk", but i want to copy the named range where the
value of the cell "ExtraRisk" refers to (this value is the name of a
named range)
....


Selection.Copy
....

End Sub