+ Reply to Thread
Results 1 to 5 of 5

Modify code to only work on a selected area and not the entire sheet

  1. #1
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Modify code to only work on a selected area and not the entire sheet

    Hi,

    As a non VBA person I am clueless so I'm back here again for more help from the people in the know. I have the code below (thanks to tehneXus for this) which removes the user name from all comments and retains the formatting (click here for thread). it does exactly as required after testing however when i applied this to real work it decided to give up after a few minutes because of the amount of comments throughout the worksheet.

    As I will only use this every few weeks when the file in question is updated and the only the one column is edited each time so to stop the computer 'freezing up' on me at work I was hoping someone can help me modify the code so that it either A) runs through selected cells or B) runs though a column of choice on the active sheet. Option A would be preferable for ease but I don't mind using B instead even if I need to change the code each time to refer to the correct column.

    Please Login or Register  to view this content.
    Thanks to all for your help.
    Say thanks, click *

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Modify code to only work on a selected area and not the entire sheet

    Not tested.

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Modify code to only work on a selected area and not the entire sheet

    Thanks for the suggestion but when tested I get "Run-time error 438 - Object doesn't support this property or method".

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Modify code to only work on a selected area and not the entire sheet

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Modify code to only work on a selected area and not the entire sheet

    Thank you for this. Tested code and all works perfectly!
    Just need to learn VB now so I can start to understand it......

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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