Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello everybody,
trying to solve my problem with using variables referring to named ranges (see the same header as bove from today) I discovered a what I believe is a fault or maybe I'm overlooking something! I have a cell named 'myRange' at M20 and want the code to navigate to this cell and paste information copied elsewhere. If I use myRange.Select Pastespecial (xlvalues) (the originating cells contains formulas) the pasting will define the value of the first cell (f.i. 'Monkey') as a Name referencing to cell M20 (cell M20 contains the pasted value/string 'Monkey' too). This new Name overrides 'myRange' in the Name-bar even though both Names (Monkey and myRange) exists, referencing to the same cell. Who is the monkey, Excel or me? Best regards Mats |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
PasteSpecial xlPasteValues will not in itself paste the name of the
originating cell into the destination cell. That is, if you have copied the first cell. If you cut it, the original cell moves to the "paste" cell and brings its name with it. This behavior is no different than if you cut and paste manually in Excel. So you can control how it behaves depending on if, before pasting, you have cut or copied the first cell. Hope this makes sense! -- - K Dales "Mats Samson" wrote: Hello everybody, trying to solve my problem with using variables referring to named ranges (see the same header as bove from today) I discovered a what I believe is a fault or maybe I'm overlooking something! I have a cell named 'myRange' at M20 and want the code to navigate to this cell and paste information copied elsewhere. If I use myRange.Select Pastespecial (xlvalues) (the originating cells contains formulas) the pasting will define the value of the first cell (f.i. 'Monkey') as a Name referencing to cell M20 (cell M20 contains the pasted value/string 'Monkey' too). This new Name overrides 'myRange' in the Name-bar even though both Names (Monkey and myRange) exists, referencing to the same cell. Who is the monkey, Excel or me? Best regards Mats |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using named variables | Excel Discussion (Misc queries) | |||
Named ranges and variables | Excel Programming | |||
Like 123, allow named ranges, and print named ranges | Excel Discussion (Misc queries) | |||
named ranges - changing ranges with month selected | Excel Programming | |||
using variables to set ranges | Excel Programming |