+ Reply to Thread
Results 1 to 3 of 3

Selection Clear Content

  1. #1
    Registered User
    Join Date
    04-04-2017
    Location
    Panama
    MS-Off Ver
    MS Office Professional Plus 2010
    Posts
    1

    Selection Clear Content

    Hello,

    I don't have a lot of experience with macros but I have an issue as the person who develop the macro is unable and we are unable to fix the issue.
    The Excel file / Macro was working properly, until there was a company system update and it's not longer working - after reviewing the code I was able to determine that the macro is having issues in this point

    Public Sub Clean()
    ActiveWorkbook.Worksheets("Review").Activate
    Rows("2:2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.ClearContents
    End Sub

    At this point the macro starts calculating and stops and Excel crashes

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Selection Clear Content

    There is nothing in the code alone that should cause Excel to crash. There must be some other combination of worksheet formulas and\or other macro code in the worksheet's code module that is contributing to the problem.

    If you right-click on the Review sheet tab and select View Code from the pop-up context menu, do you see any other code in the worksheet's code module?

    Is there a lot of formulas on the worksheet?

    Can you attach a sanitized version of your workbook that illiterates the problem?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    12-06-2016
    Location
    India
    MS-Off Ver
    2007
    Posts
    72

    Re: Selection Clear Content

    Your code is fine

    just enter your code into Module instead of Sheet if it is in sheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Clear range content
    By Mike911 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-25-2016, 10:54 AM
  2. [SOLVED] Clear content referencing another cell's same content
    By papusale in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-08-2015, 05:21 AM
  3. Clear Content from Column
    By h.noor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2015, 02:58 AM
  4. How to clear content up to row 2?
    By simplyfocus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2012, 02:17 PM
  5. Clear some content of a row
    By Nina07 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-01-2010, 08:37 AM
  6. Clear content
    By spoko in forum Excel General
    Replies: 2
    Last Post: 08-29-2007, 10:51 PM
  7. Clear an XML Map of all content
    By DangerMouse in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2006, 09:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1