+ Reply to Thread
Results 1 to 2 of 2

Clipboard clearing workaround

  1. #1
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Clipboard clearing workaround

    When you use your vba to clear cells or various other things it clears your clipboard.

    As a work around to this (i have seen far more complex workarounds but they seem pretty "janky" and over complex - trying to keep it as simple as possible) I copy the clipboard into an addin so that i can retrieve it after performing the activity that would otherwise clear the clipboard.
    Problem is that I may have done this previously and so I might have for example inserted a 2x2 set of data but i have previously used it for lets say a 3x2 one - when i retrieve all the data i get a 3 x 2 one (because I just grab all the data from the sheet) which means I have that extra data added. No good, as I want this to be robust.

    Unfortunately clearing the old data is one of the things that clears the clipboard!

    The obvious things that would solve this seem to be if I could tell the size of the data in the clipboard or tell the size of the data i just pasted in the addin. or maybe if there is another way to clear the sheet without clearing the clipboard.

    Probably there is a simple solution
    Last edited by scottiex; 04-30-2018 at 06:24 PM.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  2. #2
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Clipboard clearing workaround

    OK, I realize I can check to see if the sheet is empty and if not then create a new tab in the add-in with a name I ascribe to a global variable. So far seems to work.

+ 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. Web Query clearing pre clipboard.
    By Kris484 in forum Excel General
    Replies: 2
    Last Post: 11-22-2013, 04:32 AM
  2. clearing the clipboard
    By Stefi2000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-26-2012, 07:52 PM
  3. Clipboard clearing
    By astrikor in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-03-2009, 07:28 AM
  4. Clearing clipboard with VBA
    By nickbarthram in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2007, 07:25 AM
  5. Clearing the clipboard
    By Kevlar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-22-2006, 06:20 PM
  6. [SOLVED] Clipboard turn empty running worksheet.unprotect - workaround ?
    By Marie J-son in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-27-2006, 01:35 PM
  7. [SOLVED] Clearing the clipboard
    By Avi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2005, 09:10 AM
  8. Clearing the clipboard
    By Greg Billinge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2005, 09:05 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