View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Automatically define series of named ranges

ah!..

misread your question.

WHY set up the names anyway?

just manually enter a name like rng13
then use simple worksheetfunction offset(rng13,r,0)
or even
=offset($a$1,r,0,13,1)


that might make your pipe smoke smoother


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


Jon Tillman wrote:

On Fri, 18 Jun 2004 02:33:08 -0700, keepITcool
wrote:

Sub Name13()
Dim r&
With Range([a1], [a65536].End(xlUp))
For r = 1 To .Rows.Count Step 13
.Cells(r, 1).Resize(13, 1).Name = "rng" & Format(r \ 13 + 1,

"000")
Next
End With
End Sub


This is almost what I want, but it should create output like this:

rng001 : A1:A13
rng002 : A2:A14

I do that by changing Step 13 to Step 1, right?