Thread: Range help
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ray Batig Ray Batig is offline
external usenet poster
 
Posts: 74
Default Range help

I have a named range on a worksheet. The macro would add a new entry to the
next cell in the row. I can get this part OK. I have found an instance, say
when I first use the worksheet, when the named range is only 1 cell long
and the cell will be empty. Before I add a new column, I want to fill the
first cell if it is empty.

This is the code, however, I get an error message that the object doesn't
support this property. What do you suggest to fix this? Is there a better
way to do this?

row = Range ("MyRange").Cell(0,1).Row

If Range ("MyRange").Count = 1 And Range ("MyRange").Cell(0,1).Value = ""
Then

col = Range ("MyRange").Cell(0,1).Column
Else

col =
Worksheets("MySheet").Cells(row,256).End(xlToLeft) .Offset(0,1).Column
End If

Thanks in advance for your help!

Ray