Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-09-2012, 03:39 AM
tinfanide tinfanide is offline Range(Cell1,Cell2) Error on another workbook controlling some other workbook? Windows 7 64bit Range(Cell1,Cell2) Error on another workbook controlling some other workbook? Office 2010 32bit
Expert
Range(Cell1,Cell2) Error on another workbook controlling some other workbook?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default Range(Cell1,Cell2) Error on another workbook controlling some other workbook?



Code:
Sub test()

Dim book As Workbook
Dim sheet As Worksheet

Set book = Workbooks("test.xls")
Set sheet = book.Worksheets("Sheet1")

sheet.Activate

''' Application defined or Object defined error
sheet.Range(Cells(23, 2), Cells(47, 2)).Select
''' the below one didn't return an error
''' sheet.Range("B23:B47").Select

Set book = Nothing
Set sheet = Nothing
End Sub
When I run the Range(Cell1, Cell2).Select on a local worksheet, no problem.

But when I run the command on a local worksheet to select a range of cells on another worksheet, it returns the error (see the comment above)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Range(Cell1,Cell2) Error on another workbook controlling some other workbook? Shared Workbook SJT Excel 6 01-12-2012 11:33 AM
Loop through folder of workbooks and copy range to other workbook Snvlsfoal Excel Programming 3 07-29-2011 05:55 AM
Range(Cell1,Cell2) Error on another workbook controlling some other workbook? macro to transfer data from one workbook to another workbook virsojour Excel Programming 5 02-01-2011 08:58 PM
Range(Cell1,Cell2) Error on another workbook controlling some other workbook? Select a range in one one workbook while working in other workbook Slow&Steady Excel 1 02-21-2010 03:34 AM
Share Workbook cannot merge Ichigo Excel 3 01-19-2010 03:05 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:42 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft