Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help
I'm new to VBA and I can't seem to get this to work:
Set testrange = ActiveWorkbook.Worksheets("Mysheet").Range(Cells(3 , 8), Cells(300, 8)) it returns a 1004 error.. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help
Hi
Use this With Worksheets("Mysheet") Set testrange = .Range(.Cells(3, 8), .Cells(300, 8)) End With In your code cells use the cells in the activesheet and not in the sheet Mysheet see the dots before Cells now so it use the cells on the sheet Mysheet You can also use Set testrange = Worksheets("Mysheet").Range(Worksheets("Mysheet"). Cells(3, 8), Worksheets("Mysheet").Cells(300, 8)) -- Regards Ron de Bruin http://www.rondebruin.nl "jutes.g" wrote in message oups.com... I'm new to VBA and I can't seem to get this to work: Set testrange = ActiveWorkbook.Worksheets("Mysheet").Range(Cells(3 , 8), Cells(300, 8)) it returns a 1004 error.. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|