Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In selected range, for example a1:d234 I need to
give a1:d1 the name row1,a2:d2 the name row2 and so on.. Any suggestions? Using excel 2000. Arne |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() For i = 1 To 234 Range("A1").Resize(,4).Name = "row" & i Next i -- HTH RP (remove nothere from the email address if mailing direct) "arne" wrote in message ... In selected range, for example a1:d234 I need to give a1:d1 the name row1,a2:d2 the name row2 and so on.. Any suggestions? Using excel 2000. Arne |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tried it. It gives different name for the same range
=Sheet1!$A$1:$D$1 In selected range, for example a1:d234 I need to give a1:d1 the name row1,a2:d2 the name row2 and so on.. Any suggestions? Using excel 2000. Arne |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm guessing you're testing your macro with something like:
Option Explicit Sub testme() Dim nm As Name Dim i As Long For i = 1 To 2 '234 Range("A1").Resize(, 4).Name = "row" & i Next i For Each nm In Names MsgBox nm 'try this instead: msgbox nm.name Next nm End Sub arne wrote: Tried it. It gives different name for the same range =Sheet1!$A$1:$D$1 In selected range, for example a1:d234 I need to give a1:d1 the name row1,a2:d2 the name row2 and so on.. Any suggestions? Using excel 2000. Arne -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are all clever and helpfull! I have one problem with your solutions: I
do not always have 234 rows. In one way or another i must count the number of rows in my selection. (the numbers of columns is fixed, but a genious solutions is to count the numbers of columns in my selections) Arne "arne" skrev i melding ... In selected range, for example a1:d234 I need to give a1:d1 the name row1,a2:d2 the name row2 and so on.. Any suggestions? Using excel 2000. Arne |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can you find the last row in column A and use that?
Dim i As Long Dim LastRow as long lastrow = cells(rows.count,"A").end(xlup).row For i = 1 To Lastrow Cells(i, "A").Resize(, 4).Name = "row" & format(i,"000") Next i arne wrote: You are all clever and helpfull! I have one problem with your solutions: I do not always have 234 rows. In one way or another i must count the number of rows in my selection. (the numbers of columns is fixed, but a genious solutions is to count the numbers of columns in my selections) Arne "arne" skrev i melding ... In selected range, for example a1:d234 I need to give a1:d1 the name row1,a2:d2 the name row2 and so on.. Any suggestions? Using excel 2000. Arne -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatically define a list of words in Excel? | Excel Discussion (Misc queries) | |||
Define name Q | Excel Discussion (Misc queries) | |||
How do I define colors that are automatically applied to data seri | Charts and Charting in Excel | |||
define name | Excel Discussion (Misc queries) | |||
Automatically define series of named ranges | Excel Programming |