Error 1004 Selection.clearcontents
Forums Excel Questions ClearContents problem (SOLVED) Page 1 of 3 123 Last Jump to page: Results 1 to 10 of 21 ClearContents problem (SOLVED)This is a discussion on ClearContents problem (SOLVED) within the Excel Questions forums, part of the Question Forums category; I have this simple macro: Sheets("Sheet1").Range("A3:A1000").ClearContents When I try to run this macro, I get this error message: Run-time error ... LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Oct 10th, 2002,02:20 AM #1 phantom1975 MrExcel MVP Join Date Jun 2002 Location Omaha, Nebraska Posts 3,962 I have this simple macro: Sheets("Sheet1").Range("A3:A1000").ClearContents When I try to run this macro, I get this error message: Run-time error '1004': ClearContents method of Range class failed These are not protected cells, so I have NO idea what the issue is. Any ideas? _________________ Pass on what you have learned. Support this great website by clicking on the sponsor's ads!. [ This Message was edited by: phantom1975 on 2002-10-11 00:32 ] Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Oct 10th, 2002,02:35 AM #2 stevebausch Board Regular Join Date May 2002 Posts 810 Do you have any of the Event routines filled with code? I am guessing an interaction. What happens if you manually attempt the deletion? You could break down that line into separate actions, see which action is truly causing the problem. Sheets("Sheet1").activate 'See if this works Range("A3:A1000").select 'How about this? Selection.ClearContents 'Does this work? [ This Message was edited by: stevebausch on 2002-10-10 02:38 ] Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Oct 10th, 2002,02:43 AM #3 phantom1975 MrExcel MVP Join Date Jun 2002 Location Omaha, Nebraska Posts 3,962 I have also tried breaking it down and it still gives the same error. I am able to manually do the actions set about in the macro. I'm completely puzzled. Share Share this p
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like http://www.mrexcel.com/forum/excel-questions/23956-clearcontents-problem-solved.html you, helping each other. Join them; it only takes a minute: Sign up Run-time error '1004' Method 'Range' of object'_Global' failed up vote 0 down vote favorite I have a macro that fills in some data at the DataCell location and a few other cells based on the information it finds on the master sheet. Once it http://stackoverflow.com/questions/22382658/run-time-error-1004-method-range-of-object-global-failed finds a "blank" on the master sheet it stops. I then want it to select a range on my 'data' sheet and clear the contents of that range. For some reason I get an error in trying to select the needed range. The code dies at: Range("EmptyCell:AZ24").Select I just need it to properly select the first part of the range. This first cell will vary depending on other portions of the macro. I have looked through your other answers to similar problems and haven't been able to resolve the issue. Set DataCell = cnsu2table.Offset(0, x + 1) If DataCell <> "" Then DataCell.Offset(-2, 0) = cnsu2por DataCell.Offset(-1, 0) = cnsu2fcr DataCell.Offset(1, 0) = Application.WorksheetFunction.HLookup(DataCell, cnsu2array, 51, False) ElseIf DataCell = "" Then Set EmptyCell = DataCell.Offset(-2, 0) Range("EmptyCell:AZ24").ClearContents excel-vba range share|improve this question edited Mar 13 '14 at 15:06 Racil Hilan 8,40581936 asked Mar 13 '14 at 15:00 user3415966 52 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote accepted Change: Range("EmptyCell:AZ24").ClearContents By: Range(EmptyCell.Address
Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With http://www.tek-tips.com/viewthread.cfm?qid=1023845 Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's http://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-mso_winother/excel-vba-run-time-error-1004-application-defined/0211771e-8f9a-478a-9c61-ad00aaaaabfe functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting error 1004 Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. VBA Visual Basic for Applications (Microsoft) Forum at Tek-Tips HomeForumsProgrammersLanguagesVBA Visual Basic for Applications error 1004 selection.clearcontents (Microsoft) Forum ClearContents and ScreenUpdating issue thread707-1023845 Forum Search FAQs Links MVPs ClearContents and ScreenUpdating issue ClearContents and ScreenUpdating issue BrianWilson (Programmer) (OP) 14 Mar 05 03:37 Hi all,Hoping you can assist, I'm all out on ideas!I have a Sub in a module which calls Subs on individual sheets. The Sub in the individual sheets needs to clear a range of cells, but I do not wish the focus to change to any of these sheets from the one the user is viewing. (Note: the Subs are executed via a timer routine).The issue I am facing is that ClearContents requires the range/sheet to be selected, causing focus to be changed. ScreenUpdating does not help. Here are the code snippets:Module CodeCODESub GetPositions()Application.ScreenUpdating = FalseApplication.EnableEvents = FalseCall RETU.SendQueryCall FINU.SendQuery' etc.' etc.Application.EnableEvents = TrueApplication.ScreenUpdating = TrueEnd SubSheet Code:CODEPublic Sub SendQuery()Dim delay As StringDim uname As StringSheets("RETU").ActivateRange("A7", "L1000").ClearContents' code snipped, but essentially ActiveX call' inform user of update:RETU.Cells(1, 3) = "Last update : " + CStr(
be down. Please try the request again. Your cache administrator is webmaster. Generated Mon, 10 Oct 2016 07:36:17 GMT by s_wx1131 (squid/3.5.20)