+ Reply to Thread
Results 1 to 2 of 2

Need to recalc on selection and be able to copy and paste

  1. #1
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    Need to recalc on selection and be able to copy and paste

    Hi I have a workbook with custom functions to measure the total row height and column width of a range. But is doesn't recalculate when you adjust the size automatically, so I added a little code to each sheet to recalculate when any cell is selected
    Private sub change(ByVal target as range)
    Calculate
    End sub

    But this stops the user being able to copy and paste in the sheet as it seems to clear the clipboard
    Is there any way around this, other than having options to use application.enableevents=false

    Thanks

  2. #2
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: Need to recalc on selection and be able to copy and paste

    YES! There is a way round this.

    Open up the custom function (a/k/a UDF - user defined function) and add this line

    Please Login or Register  to view this content.
    Anytime any calculation occurs on the worksheet, the affected UDF will recalculate. Since it is part of a UDF, the undo/redo stack is not cleared.
    Last edited by JYTS; 12-05-2016 at 12:11 AM.

+ 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. VBA selection copy and paste
    By kanew7869 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2016, 03:30 AM
  2. Copy/Paste row to last available row based on selection
    By DaveNUFC in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-28-2016, 03:40 PM
  3. [SOLVED] VBA copy paste a selection then find the current date and copy this selection row 61
    By woocaro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-30-2015, 11:07 AM
  4. copy and paste go to last selection
    By ammartino44 in forum Excel General
    Replies: 2
    Last Post: 09-23-2015, 05:04 PM
  5. Copy and paste 10 cells below selection
    By garagemusic in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2014, 06:50 AM
  6. Copy Selection and Paste using Insert
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-24-2013, 07:09 AM
  7. Paste Formats causes uneeded recalc
    By eshadd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-23-2012, 07:02 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