Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Set Range on ThisWorkBook problem.

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with ThisWorkbook.RefreshAll Vick Excel Discussion (Misc queries) 3 September 7th 07 12:26 AM
Help with ThisWorkbook David Excel Programming 5 May 27th 05 11:47 PM
Help with ThisWorkbook David Excel Programming 0 May 27th 05 09:54 PM
Help with ThisWorkbook K Dales[_2_] Excel Programming 0 May 27th 05 09:50 PM
Empty ThisWorkbook module, but Macro warning problem Stuart[_5_] Excel Programming 3 June 28th 04 07:20 PM


All times are GMT +1. The time now is 01:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"