Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to define a particular range of cells so that you can just refer to the range name in the code? This is what I tried, however it didn't work. Also, if I can do this, when I use it in the code would I just put " selectrng.value = "" "if I want it to clear out all of the values in the range? Thanks. I tried it with parentheses and without and it still wouldn't work.
Dim selectrng as Range "D10:D15,F10:F15,H10:H15" |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim selectrng as Range
Set selectrng = Range("D10:D15,F10:F15,H10:H15") selectrng.Value = "" -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Matt" wrote in message ... Is it possible to define a particular range of cells so that you can just refer to the range name in the code? This is what I tried, however it didn't work. Also, if I can do this, when I use it in the code would I just put " selectrng.value = "" "if I want it to clear out all of the values in the range? Thanks. I tried it with parentheses and without and it still wouldn't work. Dim selectrng as Range "D10:D15,F10:F15,H10:H15" |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Matt,
Try this: Sub TestMe() Dim selrange As Range Set selrange = Range("D10:D15,F10:F15,H10:H15") selrange.Activate End Sub The .Activate is just to show you that the range exists as it isn't a named range (it won't show up on your range list). If you want it named, use something like this: selrange.Name = "testrange" John "Matt" wrote in message ... Is it possible to define a particular range of cells so that you can just refer to the range name in the code? This is what I tried, however it didn't work. Also, if I can do this, when I use it in the code would I just put " selectrng.value = "" "if I want it to clear out all of the values in the range? Thanks. I tried it with parentheses and without and it still wouldn't work. Dim selectrng as Range "D10:D15,F10:F15,H10:H15" |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Matt,
Try something like Dim Rng As Range Set Rng = Range("D10:D15,F10:F15,H10:H15") Rng.ClearContents -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Matt" wrote in message ... Is it possible to define a particular range of cells so that you can just refer to the range name in the code? This is what I tried, however it didn't work. Also, if I can do this, when I use it in the code would I just put " selectrng.value = "" "if I want it to clear out all of the values in the range? Thanks. I tried it with parentheses and without and it still wouldn't work. Dim selectrng as Range "D10:D15,F10:F15,H10:H15" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Defining Range Name | Excel Discussion (Misc queries) | |||
Defining a range | Excel Worksheet Functions | |||
Defining Range Question? | Excel Programming | |||
Defining Range Extent | Excel Programming | |||
Defining Range | Excel Programming |