Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am sure it is obvious but when I have been programming intensely
apparently obvious things become obscured, any help appreciated: Dim InvVCVRange As Range Dim AlphaRange As Range Set InvVCVRange = Sheets("InvVCV").Range(Cells(2, 2), Cells(11, 11)) I get application definmed or object defined error! Kind regards, Mark |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cells defaults to the ActiveSheet if not fully qualified. So
Set InvVCVRange = Sheets("InvVCV").Range(Cells(2, 2), Cells(11, 11)) is equivalent to Set InvVCVRange = Sheets("InvVCV").Range(ActiveSheet.Cells(2, 2), _ ActiveSheet.Cells(11, 11)) so if InvVCV is not active, you'll get an error, since ranges can only exist on a single sheet. Try With Sheets("InvVCV") Set InvVCVRange = .Range(.Cells(2, 2), .Cells(11, 11)) End With instead. In article , "BT" wrote: I am sure it is obvious but when I have been programming intensely apparently obvious things become obscured, any help appreciated: Dim InvVCVRange As Range Dim AlphaRange As Range Set InvVCVRange = Sheets("InvVCV").Range(Cells(2, 2), Cells(11, 11)) I get application definmed or object defined error! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Jem,
I really appreciate the help, works perfectly now - I love this user group:) "JE McGimpsey" wrote in message ... Cells defaults to the ActiveSheet if not fully qualified. So Set InvVCVRange = Sheets("InvVCV").Range(Cells(2, 2), Cells(11, 11)) is equivalent to Set InvVCVRange = Sheets("InvVCV").Range(ActiveSheet.Cells(2, 2), _ ActiveSheet.Cells(11, 11)) so if InvVCV is not active, you'll get an error, since ranges can only exist on a single sheet. Try With Sheets("InvVCV") Set InvVCVRange = .Range(.Cells(2, 2), .Cells(11, 11)) End With instead. In article , "BT" wrote: I am sure it is obvious but when I have been programming intensely apparently obvious things become obscured, any help appreciated: Dim InvVCVRange As Range Dim AlphaRange As Range Set InvVCVRange = Sheets("InvVCV").Range(Cells(2, 2), Cells(11, 11)) I get application definmed or object defined error! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to update a column in a work based on another work sheet | New Users to Excel | |||
how can i automatically generate work order numbers from work orde | Excel Discussion (Misc queries) | |||
flash object dont work in my excel work sheet | Excel Discussion (Misc queries) | |||
Counting dates in multiple work sheets and work books | Excel Discussion (Misc queries) | |||
Is there away to keep "auto save" from jumping to the first work sheet in the work book? | New Users to Excel |