View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Range Objects + Names + Error 1004

Maybe fully qualifying that range would help:

Set rng = Worksheets("Master").Range("Clothing")
(guessing that Clothing is on the Master worksheet)

You may want to double check your spelling of the name, too. Maybe it was a
typo.

David wrote:

I seem to be running into the 1004 error on what I thought would be
something simple. I have created 4 names
one of which is "Clothing", it refers to cells B4 to B8. I want to
simply place the arrData into each of the five cells.
I can't get past that line setting the range object. I thought
setting range objects was easy. The range is already named what is
causing this error? A piece of the offending code follows: Is there
some "rule of thumb" to follow when setting and using range objects, I
always seem to be getting thrown with them. Thanks David.

Public Sub ApplyData()

Dim i As Integer
Dim j As Integer
Dim rng As Range

Sheets("Master").Activate

Set rng = Range("Clothing") ' Can't get past this line
rng.Cells(1) = arrData(0, 0)
rng.Cells(2) = arrData(0, 1)
rng.Cells(3) = arrData(0, 2)
rng.Cells(4) = arrData(0, 3)
rng.Cells(5) = arrData(0, 4)
.
.
.
End sub

As Always Much appreciated!


--

Dave Peterson