Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for your time on my problem. I have learnt more from what you have
said but Paul below understood exactly what I was trying to say. Sue "Incidental" wrote: Hi Sue From your code it looks like you have recorded a macro and you are trying to incorporate it into your code? depending on why you want to name the range you could use a different method which is to set the range using VBA. This code is an example of how setting a range to a variable that you can refer to in your code. Just copy it into a module and step through it (pressing the F8 key to run the code line by line) and it should give you an idea of how it works. Option Explicit Dim MyRng As Range 'Declare your range Sub SetARange() Set MyRng = Range(ActiveCell, ActiveCell.Offset(1, 0)) [MyRng].Select [MyRng].Value = "I'm a range called MyRng" [MyRng].Copy Destination:=[A1] End Sub I hope this is of some use to you Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Range naming | Excel Discussion (Misc queries) | |||
Module naming | Excel Programming | |||
Naming a range | Excel Discussion (Misc queries) | |||
naming a range | Excel Programming | |||
VB Code Naming a Range (range changes each time) | Excel Programming |