+ Reply to Thread
Results 1 to 4 of 4

Worksheet change event copy column error

  1. #1
    Forum Contributor
    Join Date
    07-01-2012
    Location
    ZA
    MS-Off Ver
    Excel 2013
    Posts
    300

    Worksheet change event copy column error

    I have a workbook with 2 sheets HistoryD and HistoryDD ....I have the following code to copy Column A-G from HistoryD to HistoryDD if any value is changed on B2-G2 -but when I change a value the macro thats been called have a n error about the range "Select error of range failed"...it complains about this line Range("A1").Select . Rep given for solution as its done with the macro recorder but its not running through ....What must be changed in the code ?? Thank you

    Please Login or Register  to view this content.
    Last edited by ricklou; 01-21-2017 at 04:16 AM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Worksheet change event copy column error

    The problem is that you're switching sheets and that is not allowed with events, you have to approach it differently. Not inside a worksheet module
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    07-01-2012
    Location
    ZA
    MS-Off Ver
    Excel 2013
    Posts
    300

    Re: Worksheet change event copy column error

    Quote Originally Posted by Keebellah View Post
    The problem is that you're switching sheets and that is not allowed with events, you have to approach it differently. Not inside a worksheet module
    Thanks i fixed it

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Worksheet change event copy column error

    Good, glad you solved it

+ 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. Worksheet change event with multiple column cell value change
    By borgyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2015, 11:53 AM
  2. Need to add if error code to worksheet change event to stop a run-time error
    By KT99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2014, 03:10 PM
  3. Worksheet Change event ignore change event
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2011, 12:29 PM
  4. runtime error, isempty, worksheet change event
    By Code Flunkie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2011, 05:17 PM
  5. [SOLVED] [SOLVED] Worksheet change event-single column
    By jasminesy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2006, 01:30 PM
  6. Worksheet Change Event-change event to trigger
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-18-2005, 06:05 PM
  7. Replies: 5
    Last Post: 06-23-2005, 06:05 PM

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