Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
peculiar error with Range() object | Excel Programming | |||
Dyanamic range - Object Required Error? | Excel Programming | |||
error 1004 Range object | Excel Programming | |||
Dynamic range (object variable error) | Excel Programming | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming |