Select Method of Range class failing???

Hello,

I keep getting the following error in my macro:

Run-time error '1004':

Select method of Range class failed

When simply trying to select cell A1 in a worksheet of mine.  I can'
figure out for the life of me why this would be failing.  Here's m
script (literally):

Range("A1").Select

I am simply trying to position the cursor on a worksheet in preparatio
for a possible operation.  I have never had this fail on me before an
I can't figure it out now.

Any ideas why this might be happening?

Thanks in advance,

-Pet

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

0
7/13/2004 8:52:18 PM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
461 Views

Similar Articles

[PageSpeed] 13

if your code is in a worksheet module and you're selecting a different
worksheet, try:

	with worksheets("othersheetnamehere")
            .select
            .range("a1").select
        end with

You can only select a cell on the activesheet.  And an unqualified range behind
a worksheet refers to the sheet that owns the code--not the activesheet.

If you're using xl97 and call the code from a control from the control toolbox
toolbar (like a commandbutton), then add this to the top of your procedure:

	activecell.activate

(if the control has the .takefocusonclick property (like the commandbutton),
then change that property to false--this is a bug in xl97 that was fixed in
xl2k.)



"Peter Bernadyne <" wrote:
> 
> Hello,
> 
> I keep getting the following error in my macro:
> 
> Run-time error '1004':
> 
> Select method of Range class failed
> 
> When simply trying to select cell A1 in a worksheet of mine.  I can't
> figure out for the life of me why this would be failing.  Here's my
> script (literally):
> 
> Range("A1").Select
> 
> I am simply trying to position the cursor on a worksheet in preparation
> for a possible operation.  I have never had this fail on me before and
> I can't figure it out now.
> 
> Any ideas why this might be happening?
> 
> Thanks in advance,
> 
> -Pete
> 
> ---
> Message posted from http://www.ExcelForum.com/

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
7/13/2004 11:55:29 PM
Thank you very much for your reply.  The With..End With seems to hav
worked.

I am calling this using a command button but I happen to be working i
xl2000.  I suspected a bug along the lines of what you mentioned fo
xl97, but I guess that's not the case.

Thanks again!

-Pet

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

0
7/14/2004 3:09:51 PM
Reply:

Similar Artilces:

drop down menu to select suppliers, categories, etc in report filt
When generating a report in Store Operations RMS, not all the filter fields have available drop down menus to select available suppliers, categories, etc. This would make it easy to select an available supplier from a drop down menu rather than hoping to remember a supplier name or spelling it correctly. Same suggestion for categories, departments, etc...... ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the ...

Method or Data Member Not Found 12-29-09
Access03/WinXP In what should be a very basic reference, I am getting an error "Method or Data Member Not Found" in the following code. I'm guessing form corruption? If Me.cboRollUpType = 1 And Me.txtMGR1 <> "" Then resp = MsgBox("A MGR1 participant is already assigned. Do you want to update with your selection?", vbYesNo) The code fails on "Me.cboRollUpType". The combo box is indeed named cboRollUpType. Even if I delete the reference in the code and start typing "Me.", after I type the period I can select &qu...

multiple select list boxes on form
I'm reposting this because I have been working for over three weeks trying to develop the VBA code and was hoping to stay in that vicinity. My form has multiple-select list boxes (both text and numbers) that contain customer contact info, company revenue, and sales relationships. How do I loop the code so that the form displays (which will eventually be exported to Excel) only the records based on the multiple criteria selection within each box? Any help you can offer is appreciated. I can get the code to work for one multiple-select dropdown filter, and I can get the code to work for...

Target.Address Being One Of The Cells Of A Named Range
I have applied a name to a collection dispersed cells and want to use the same as follows but require a correct piece of code for <<???>>: Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: If Target.Address <<IS A CELL OF THE RANGE NAMED "CELLS">> Then MsgBox "YES!" End If ws_exit: Application.EnableEvents = True End Sub -- Thanx in advance, Best Regards, Faraz Hi Faraz Try Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Target, Range("...

export selected data, without formulae
I have a spread sheet with two worksheets, one containing the main information the other with a discount percentage. Once a month I need to export 9 columns of information for management in CSV form. Column 8 contains a formulae which relates to column 10 and worksheet 2 I need to show CSV report with data from column 8 but not from column 10 or worksheet 2. HELP HOW do I do this........... -- sales Create a new workbook. copy your range from the first workbook edit|paste special|values to the worksheet in that new workbook. Save that new workbook as a .csv file (then close without sav...

Changing font case in a selected column
Probably an easy one for you experts but I am very frustrated! I have copied data from one worksheet to another and to tidy it up I want to change the font from sentence case e.g. Hume to upper case e.g. HUME. How do I do it? Many Thanks Paul With Hume in A1, put this in B1 =UPPER(A1) it will display as HUME....... Note that =PROPER(B1) in cell C1 will turn it back to Hume....... Vaya con Dios, Chuck, CABGx3 "PAUL HUME" <paul.c.hume@jobcentreplus.gov.uk> wrote in message news:0a4101c34608$450edaf0$a501280a@phx.gbl... > Probably an easy one for you experts ...

trying to select multiple cells
Hello. I can't remember how to select multiple cells in this worksheet. example I want to select a1 to i11 or something. I need to use the keyboard for this as I am visually impaired and cannot use a mouse. Thanks. Select first cell, then Hold Shift while move select cell to the other = corner cell Or you can use F8 as follows Select first cell, then press F8 now movement of the selected cell will = = produce a select area. To produce multiple blocks Shift F8 will keep the selected area, now move to another area, Shift F8= = to start a new block Steve On Sun, 10 Sep 2006 ...

OWA with problems with Premium client selection
Hi, When I run OWA with the Premium client selection, I can't open the emails, but if I login with basic client selection, there is no problem with it. When entering the site, IE gives me an error: Line 15 Char 30 Error: Object expected Code: 0 URL: https://......... Can anyone help? Thanks in advance What browser and OS are you using? Nue "Andre Guimaraes" <Andre Guimaraes@discussions.microsoft.com> wrote in message news:0807EBCA-78D4-4F5F-AF5A-20F6B1E55AEC@microsoft.com... > Hi, > > When I run OWA with the Premium client selection, I can't open the e...

How do I change a date range in a 2003 calendar with no wizard in
I do a club newsletter which has an upcoming events calendar showing three months at a time. Each month one month gets dropped off and another gets added. I do this by using the wizard in 2003. The same wizard is not in 2007 version. How do I do this change now? The calendar wizard is about the same in both versions. Which calendar template are you using? Are you using full page calendars or calendars from the Design Gallery? -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Lyn" <Lyn@discussions.microsoft.com>...

Prevent SORT from asking to expand selection in Excel 2007?
Has anyone figured out how to stop EXCEL 2007 from constantly asking if it should "Expand the selection" or "Continue with the current selection?" I have to sort answers I'm creating for multiple-choice tests, so my data bank has groups of four answers that I sort alphabetically one group after another. The wretched program constantly pops up this "Sort Warning" that forces two extra clicks or keystrokes for every sort! I'm sure that someone thought the warning would be useful, but I'M SICK OF IT! It should be possible to TURN IT OFF!!! ...

pivot table data range
I am creating a pivot table in one excel file and pulling the data source from another excel file. The problem is the name of the data source file changes every month to coordinate with the new reporting month. For an example, the name goes from this: datasource 403.xls, to this: datasource 503.xls. How can I enter the range name of this file without manually changing the date in the range? Can I use a cell reference in the name range, which I have tried unsuccessfully? Help Dawn 1. Can't you just use Edit/Links ? 2. Could try Edit/Replace. 3. I have files with daily name chang...

Send/Receive Error Message: Operation Failed
Hello there, I am using Outlook 2002 with XP (Home Edition) and have been for at least 1.5 years. Today, for no apparent reason, I got the "operation failed" error mesaage when I clicked Send/Receive. I still get any email when Outlook automatically seeks it, I just can't do it manually. Any thoughts? Thanks for you help. See if http://support.microsoft.com/default.aspx?scid=kb;en-us;312354 helps. -- Jeff Stephenson Outlook Development This posting is provided "AS IS" with no warranties, and confers no rights "Bill S" <Bill S@discussions.microsoft...

outgoing mail fails only to ONE specific domain!???
I'm at a loss here. Running exchange 2000 and server 2000 Everything seems to be working fine - but we cannot send email to ONLY ONE domain! Any email sent from the exchange server to 'callcommnad.com' fails - the application log just shows a 4000 error; "Message delivey to the remote doman 'callcommand.com' failed." It will retry per my queue settings and then eventually the original sender will get a 4.4.7 error; 'Could not deliver the message in the time limit specified. Please retry or contact your administrator.' nslookup resolves thier MX pro...

Outlook client is switching authentication methods
We regularly get a message saying that the CRM client can not authenticate with th server and is switching authentication methods. It then goes on to work perfectly however I do have other instability issues which I am concerned this is the underlying cause. Does anyone know what causes this message? ...

Query for count of temperature ranges
I am not sure if I can do this but I have this data in my table Date1 Shift1 Temperature Date1 Shift2 Temperature Date2 Shift1 Temperature Date2 Shift2 Temperature etc... What I will like to do is to come up with a count when the temperature for one shift is above 32 degrees and the next shift falls below 32 degrees. Is this possible? Thanks in advance There may be a smarter way of doing this in a single query, but this will work. Assuming you always have exactly 2 shifts (shift1 and shift2) in a given day: Use a Make-Table query with Criteria of shift = 'Shift...

Copy-Paste Value based on user defined range
Hello, I am trying to create an option such that, the user can input a default value in one cell, enter a start year, and the number of years he wants to assign this value for. Ex. A B C 1 Value Start Year # of Years 2 500 2005 5 Apply 500 starting in 2005 for the next five years including 2005. I am working in Excel2000. Thanks for your help ...

Delete Range of cells and move left based on Cell value
Hi..I am trying to delete a range of cells in a column and move them left based on whether or not a certain cell = 0. Any help would be great, thanks, Bill details -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "Thomp" <williamthomp@gmail.com> wrote in message news:5ff00479-4448-4767-aaaa-8923370249b4@o3g2000yqb.googlegroups.com... > Hi..I am trying to delete a range of cells in a column and move them > left based on whether or not a certain cell = 0. Any help would be > great, > > thanks, > Bill Wow...

Frigidaire FEF336FM Electric Smoothtop Range w/ Manual Clean Oven
Price:$491.02 Image: http://thediscountdatabase.info/image.php?id=B000Y8SSOS Best deal: http://thediscountdatabase.info/index.php?id=B000Y8SSOS This 30 free standing model has a black Ceramic Smoothtop Cooking Surface which are Seamless and Upswept. Two six inch elements, one eight inch element and one nine inch elment. It also features a Vari-Broil setting with 2 positions, Hi/Lo. The control panel is a SmoothTouch Backguard Design for easy cleaning. This 4.1 Cu. Ft. oven capacity features an extra-large window that is 87% larger than the standard window. The Extra-Large Visualite Wind...

Naming a Range in Excel
When importing data from Excel into Outlook Contacts I get an error message telling me I havent named a range in Excel to import. I rtm and can't find anything on this Range Naming. Anyone know how to do this? Dave, Either use Insert|Name|Define or highlight the range and type the name you want in the name box (the box that shows the active cell address, which is usually above A1) PC "dave" <ddempsey@ccim.net> wrote in message news:00cd01c36d76$86dc9f40$a101280a@phx.gbl... > When importing data from Excel into Outlook Contacts I get > an error message tell...

get and set methods for attributes?
Is it possible to get Visio to generate get and set methods from a class diagram for attributes automatically (C++ code)? I think this is in the realm of "Visio for Enterprise Architechts", but I'm not 100% sure. That product tends to be "two-way" with regards to code and databases. You'll have to check the data sheets, or hope one of the other smart guys answers this question. Check here too: http://www.microsoft.com/technet/prodtechnol/visio/visio2002/plan/visdbmdl.mspx -- Hope this helps, Chris Roth Visio MVP "James" <james@hotmail.com...

excel VBA to select specific rows
I have created a userform in excel VBA use as a data entry form and I have created this VBA code: iRow = ws.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).Row ws.Cells(iRow, 3) = TextBox1.Value My problem is how to set this code to start the data from row 10 and column 3, because currently it start from raw 2 and column 3. Thanks very much for the help. ws.Cells(10, 3) = TextBox1.Value -- Regards Dave Hawley www.ozgrid.com "dodong" <dodonglopez@yahoo.com> wrote in message news:91c08d4a-5911-4569-95ca-bb9d537a2c27@u20g2000pru.googlegroups.com... &g...

The operation failed. Anobject could not be found.
Hi I am getting this error message only when I click on either "for follow" up or "unread mail" in the top favorites folder in outlook 2003 sp2. I tried googling but no luck. Most people getting this error message get it when clicking send/receive. My send receive works great. I tried doing a detect repair and a scanpst. What next? TIA Ok I figured it out. I deleted unreadmail and for follow items from outlook search folder, and recreated them. ...

Fallen into a range
My problem is how to compute how many times a number falls into the range. For example we have ranges: 12 - 20 15 - 40 7-18. How many times falls "13" into above ranges? Thanks for help!!! --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.797 / Virus Database: 541 - Release Date: 2004-11-15 What excatly do your "ranges represent"? A group of cells? If not, I'm not sure I understand how 13 could fall into 15-40. If you want to count occurrences of the number 13 in a range of cells: =countif(your_ran...

FRX Drill Down Viewer fails to open
We are running Great Plains and FRX reporting via a citrix client and have a problem on one PC. The user runs any report which after completing fails to open the FRX Drill Down Viewer. No error is displayed, the reports just fail to appear. We have run the same reports on other Users PC's without problems, we have used the login for the failing user on another PC all with no problems. We have reinstalled the Citrix client and compared our Users settings but can see no differences. Any help or advice would be greatly appreciated. Have you tried to re-install FRx? The drill down vie...

AutoConfig API fail because of Domain Policy
Hi, The call to WlanSetInterface with op-code to disable AutoConfig is failing with error code ACCESS DENIED. Is this because of some kind of Domain Policy enforced by the Win7 server? I would appreciate any input on this. Thanks, Vani -- vani Posted via http://www.win7heads.com ...