LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting a Range of cells in VBA

Hello,

I keep having problem with the range() method in VBA. While it seems t
be a straightforward method, I cannot apply it with consistent success
Even worse, I trigger the command the same way, but sometimes it work
fine while other times I kept getting the "select method of range clas
failed". For example, I created a button that had only these tw
lines:

sheet9.activate
sheet9.range("a10:e15").select

These two lines worked fine, but I don't understand why I had t
activate the sheet since I already specify the sheet to look for in m
range() method.

Even worse, when I tried to use the cells() method to specify th
range:

sheet9.activate
sheet9.range(cells(10,1),cells(15,5)).select

the abovementioned error occur. I have no idea why the failure or ho
to fix the problem. I just don't understand. Every single book I hav
talks about the range method as though it's the simplest method ther
is (that's what I thought too).

I would truly appreciate if anybody can explain this to me

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for Selecting Cells within a Range ToddS Excel Worksheet Functions 2 April 3rd 09 09:04 PM
Selecting a range of cells in a macro Victor Delta[_2_] Excel Discussion (Misc queries) 5 July 26th 08 12:19 AM
Selecting a range of cells, how to ? Luc Excel Worksheet Functions 2 February 23rd 07 07:17 PM
Range selecting cells Alec H Excel Discussion (Misc queries) 2 March 14th 06 01:36 PM
Selecting a range of cells Kevin Excel Programming 5 October 10th 03 03:03 PM


All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"