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: 8
Default peculiar error with Range() object

Try out the following code. If sheet2 is active, all 3 procedures work fine, but if sheet2 is not
active, TestRangeCells will not work but the other 2 procedures work fine. Anyone know why there is
a difference?

Sub TestRangeA1()
Sheets(2).Range("a1:a2") = 99
End Sub

Sub TestRangeCells()
Sheets(2).Range(Cells(1, 1), Cells(2, 1)) = 99
End Sub

Sub TestCells()
Sheets(2).Cells(1, 1) = 99
Sheets(2).Cells(2, 1) = 99
End Sub


 
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
Very Peculiar DV error Q Sean Excel Worksheet Functions 9 November 16th 07 01:46 PM
error 1004 Range object Tony James[_2_] Excel Programming 3 December 19th 05 03:11 PM
Error inserting formulas into a range object Josh22[_3_] Excel Programming 1 August 4th 05 11:55 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
Peculiar Runtime Error 1004 Jim Berglund Excel Programming 6 April 30th 04 06:22 PM


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