Add following code before the line:

Worksheets("Ratios").Select         (to select the sheet before you select the 
range in the sheet)

New code should look like:

Private Sub CommandButton3_Click()
Worksheets("Ratios").Select
Worksheets("Ratios").Range(Cells(3, 25), Cells(3, 26)).Select
End Sub
 
Regards,
Alokeshwar
09891442001

_________________________________________________________________________________________________
"There are known knowns. These are things we know that we know. There are known 
unknowns. That is to say, there are things that we know we don't know. But 
there are also unknown unknowns. There are things we don't know we don't know."




________________________________
From: tushar patki <tusharpa...@gmail.com>
To: excel-macros@googlegroups.com
Sent: Sun, 27 December, 2009 11:39:33 AM
Subject: $$Excel-Macros$$ range method not working


Dear Experts

I am trying to get solution by this code

Private Sub CommandButton3_Click()

Worksheets("Ratios").Range(Cells(3, 25), Cells(3, 26)).Select

End Sub

First line of procedure is not working---- giving error as 1004 - Select method 
of range class failed. But When I merely try the code as follows(without giving 
the sheet reference): It works in the same sheet in which I have written the 
code. I wonder how? Can anybody solve this:

Private Sub CommandButton3_Click()

' Worksheets("Ratios")

Range(Cells(3, 25), Cells(3, 26)).Select

End Sub

Please help.

Tushar-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us in TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 
To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!
 
We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe



      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
http://in.yahoo.com/

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us in TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to