Hi Sandra,
Try turning turning macro recorder on and
perform the necessary operations manually.
This will provide you with code which may
be edited to afford more generic application.
If you experience problems in editing the
recorder code, post back with the
problematic code
---
Regards.
Norman
> Hello -
>
[quoted text clipped - 16 lines]
> many thanks
> sandra
Sandy - 30 May 2008 15:09 GMT
Hello Norman -
Here is the code from the macro:
Range("B2").Select
Selection.Copy
Range("A1:A2").Select
Range("A2").Activate
Application.CutCopyMode = False
ActiveWorkbook.Names.Add Name:="NameOfRange", RefersToR1C1:= _
"='Lookup Range'!R1C1:R2C1"
Range("B4").Select
The prblem is that the range always changes so I need it to be start at the
first cell, then move left 1 cell and (SHIFT) up 1cell - something like this:
Range("R2C2").Select
Selection.Copy
Range("RC-1:R-1C-1").Select etc ....
Also, the name of the range (Add Name:="NameOfRange")
needs to always change, based on what was copied and not be a fixed value.
Hope this clarifies the requirement a bit.
s-
> Hi Sandra,
>
[quoted text clipped - 31 lines]
> > many thanks
> > sandra
Try this:
Sub Name_Range_for_Sandy()
'Name a range the value of the ActiveCell
'The range consists of two cells
'the cell to the Left
'and the cell above the cell to the left
Range(ActiveCell.Offset(-1, -1), ActiveCell.Offset(0, -1)).Name _
= ActiveCell.Value
End Sub
Good Luck.
> Hello -
>
[quoted text clipped - 15 lines]
> many thanks
> sandra
Sandy - 30 May 2008 15:30 GMT
This worked perfectly - thank you so much!
> Try this:
>
[quoted text clipped - 30 lines]
> > many thanks
> > sandra