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 Set Range on ThisWorkBook problem.

First, lColumn should be a Long--or at least a number.

And second, when I changed that, your code worked ok.

Cesar Zapata wrote:

I get an error whe trying to set a range on the thisworkbook.range

dim lcolumn as string

lcolumn =
ThisWorkbook.Worksheets(2).Range("IV1").End(xlToLe ft).Offset(0,
1).Column

Set myrange = Range(ThisWorkbook.Worksheets(2).Cells(1, 24),
ThisWorkbook.Worksheets(2).Cells(1, lcolumn))

TIA

CZ


--

Dave Peterson