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: 6
Default Range Object error

i All
This maybe a newby question but I have searched for an answer without any
luck.

When i attach the following code to a command button click event
Private Sub TestButton_Click()
Range(Cells(1, 1), Cells(5, 3)).Font.Italic = True ' This works fine
Worksheets("Data").Range(Cells(1, 1), Cells(5, 3)).Font.Italic = True '
This produces a 1004 error

Worksheets("Data").Range("J3:J6").Value = "Hello" ' This works fine
Worksheets("Data").Range(Cells(3, 10), Cells(6, 10)).Value = "World" '
This produces a 1004 error

Set myRange1 = Worksheets("Data").Range("J3:J6") 'This works fine
Set myRange2 = Worksheets("Data").Range(Cells(3, 10), Cells(6, 10)) '
This produces a 1004 error
End Sub

I am obviously referencing the RANGE object incorrectly but I dont see how.

Is there anothe way people use to reference a multicell range using numeric
veriables??

Thanks for your assistance

Lance
 
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
peculiar error with Range() object Jeff[_42_] Excel Programming 2 July 2nd 06 09:36 PM
Dyanamic range - Object Required Error? Craigm[_50_] Excel Programming 0 April 6th 06 04:47 PM
error 1004 Range object Tony James[_2_] Excel Programming 3 December 19th 05 03:11 PM
Dynamic range (object variable error) Mslady[_14_] Excel Programming 3 November 1st 05 05:19 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM


All times are GMT +1. The time now is 06:51 PM.

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"