LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 106
Default Use a Variable to select a range

I know this has to be fairly simple, but I've searched all the topics
and can't determine how to do the following. I am trying to select a
range based on certain criteria. I am looping through the range using
a counter.


For Counter = 9 To LoopValue
Set curcell = Worksheets("Compiled
Totals").Cells(Counter, 4)

If curcell.Value = 0 Then
Sheets("Compiled Totals").Range(Cells(Counter, 1),
Cells(Counter, 15)).Select
Selection.Copy
'Other code to paste the range on another
spreadsheet
End If
Next Counter


I keep getting the 1004 error for the following line:
Sheets("Compiled Totals").Range(Cells(Counter, 1), Cells(Counter,
15)).Select

What am I missing?

Thanks. Connie

 
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
Variable Range sep1280 Excel Worksheet Functions 3 March 6th 06 07:17 AM
Set a range from a variable location Troubled User Excel Discussion (Misc queries) 2 November 27th 05 12:05 AM
Using a range variable inside a excel function Michael Excel Discussion (Misc queries) 2 November 14th 05 02:52 PM
Select Using Range vijaya Excel Discussion (Misc queries) 1 November 2nd 05 07:33 PM
Select a range Kevin Excel Discussion (Misc queries) 3 February 18th 05 11:04 PM


All times are GMT +1. The time now is 01:45 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"