LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet().Range(Cell(), Cell()) syntax?


Probably another newb question from me, but:

What is the proper syntax to use the Range(Cell(), Cell()) selection
when accessing a different worksheet?

example

On sheet1 I have the code:

Range(Cells(1, "A"), Cells(30, "A").select

This will of course select the range of cells A1:A30 on sheet1

It also works fine if I use

Worksheets("Sheet1").Range(Cells(1, "A"), Cells(30, "A")).select





However, if I use the code to try to select a different sheet, ala:

Worksheets("Sheet2").Range(Cells(1, "A"), Cells(30, "A")).select

I get an error back: "Run-time error '1004': Application-defined or
object-defined error"



Even if I make sheet2 the activesheet the code still returns the same
error.


--
Ouka
------------------------------------------------------------------------
Ouka's Profile: http://www.excelforum.com/member.php...o&userid=23988
View this thread: http://www.excelforum.com/showthread...hreadid=388946

 
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
Using a cell in the worksheet as a range in a VBA routine dhstein Excel Discussion (Misc queries) 2 December 4th 08 12:13 AM
Copying cell with input range to different worksheet Doug T[_2_] Excel Worksheet Functions 4 October 4th 07 04:11 PM
Worksheet Cell Range Name within VB Subroutine Jay Somerset Excel Discussion (Misc queries) 5 February 6th 06 02:27 PM
selecting cell range in other worksheet without switching to worksheet suzetter[_4_] Excel Programming 4 June 22nd 05 08:55 PM
Hide cell range in worksheet Man Utd Excel Programming 1 June 16th 05 12:28 AM


All times are GMT +1. The time now is 03:08 PM.

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"