Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
Apologies for this - this is probably quite a basic question, but I'm afraid I can't seem to find the answer, and all the bookshops I'd go to for something to help me out are closed at this time of night. In my defence, I started working with VBA about four hours ago. I've got a subroutine (lifted from another thread in this group) which is adding two ranges. This is great when the ranges are on the same sheet, but VBA doesn't seem to like attemts to pass ranges from other pages. So when I try AddRanges Range("F6:J10"), Range (Sheet2.Range("C4:G8")) calling a subroutine Private Sub AddRanges(RangeOne As Range, RangeTwo As Range) I get a run-time error 1004 - Method "Range" of object '_Worksheet' failed. I've tried playing with the quotes and brackets, but haven't had any success. The Sheet2 reference works fine for a straightforward copy, so is it something about passing this sort of range as a parameter? Thanks for any help, Mike |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing a Range | Excel Programming | |||
Passing a range into a VBA function | Excel Programming | |||
passing range to c# | Excel Programming | |||
Passing range as argument | Excel Programming | |||
Passing range to subprocedure - maybe? | Excel Programming |