LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
DG DG is offline
external usenet poster
 
Posts: 46
Default Selecting Ranges using Variables

I currently have Sheet2 active in this example:

Sub TestIt()
Dim Line as Integer

Line = 8
x = 1

While Cells(x,1) < ""
Sheets("Sheet1").Range("A" & Line & ":K" & Line).Select
x = x + 1
Wend
End Sub

I get an error on the Select statement "Select Method of Range Class
Failed".

I am trying to select Range("ALine:KLine") where Line is the variable.

Any help would be great.

DG


 
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
Selecting Rows using Long Variables pallaver Excel Discussion (Misc queries) 2 July 14th 08 07:13 AM
problem selecting a range using variables cass calculator Excel Programming 3 May 23rd 06 09:43 PM
Selecting Non-Consecutive Variables Colin Vicary Excel Discussion (Misc queries) 3 February 2nd 06 09:01 AM
Using Ranges to input variables to UDF Peter Bradley Excel Programming 3 October 3rd 04 12:14 PM
using variables to set ranges Dave Marden[_2_] Excel Programming 1 December 2nd 03 01:24 AM


All times are GMT +1. The time now is 02:22 AM.

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

About Us

"It's about Microsoft Excel"