View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
sgl sgl is offline
external usenet poster
 
Posts: 80
Default Determine specific range

Hi all,

I have the following code

Dim MyBook as Workbook
Dim SrcRange as Range
Dim ShtName as Variant
Dim N as Interger

.... Code ...

set
SrcRange=Mybook.Workshhets(ShtName(N)).Range(Range ("A2"),Range("A2").SpecialCells(xlLastCell))

.... morwe code

This gives me an Application or Object Defined Error. If I use the following
it works well but I do not get the specific range I need.

set SrcRange=Mybook.Workshhets(ShtName(N)).UsedRange

Can someone pleasse help with this as it is driving me barmy

Thanx in Advance/sgl