Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I understand you correctly, I think you want this...
Range(Range("ExtraRisk")).Copy -- Rick (MVP - Excel) "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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
you mean this : Range(Range("ExtraRisk").address).Copy | If I understand you correctly, I think you want this... | Range(Range("ExtraRisk")).Copy " |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nope, that is not what I meant. The OP said this...
1) I have a cell which i have named "ExtraRisk". 2) This cell contains text : example "Electricity", which is also the name of a range. 3) Now i want to select this named range "Electricity" & copy the range Numbers 1 and 2 tell me that the contents of Range("ExtraRisk") is the word Electricity and that Electricity is a named range. Number 3 says the OP wants to copy Range("Electricity"). Since Range("ExtraRisk") contains the word "Electricity", we can do a direct substitution, putting Range("ExtraRisk") in place of the word "Electricity"; hence Range(Range("ExtraRisk")) points to whatever the named range "Electricity" points to; so, according to Number 3, we want to copy that... Range(Range("ExtraRisk")).Copy I guess the only thing this expression can be faulted for is relying on the default value of the Range object; perhaps this would have been more to your liking... Range(Range("ExtraRisk").Value).Copy -- Rick (MVP - Excel) "michdenis" wrote in message ... Hi, you mean this : Range(Range("ExtraRisk").address).Copy | If I understand you correctly, I think you want this... | Range(Range("ExtraRisk")).Copy " |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting more than 1 named range | Excel Programming | |||
selecting a named range based on a cell value | Excel Programming | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) | |||
Selecting and deleting named range based on cell value | Excel Programming | |||
If any cell in named range = 8 then shade named range | Excel Programming |