Jump to content
groovyPost Forums

Issue with Copying Excel Cells


zines
Go to solution Solved by Austin,

Recommended Posts

Hello,

I have asked this question at a couple of other places and nobody has been able to come up with a solution. Before asking this question I already believed there wasn’t a solution to this, but I will try it again to see if someone should happen to have a solution for this.

In Excel when you copy a cell the border starts moving/flashing. Only when that border is moving you are allowed to paste its contents into another cell. Once the border is no longer moving, you are also unable to paste its contents. The other option is to double click on the cell or go into the formula bar to manually copy the data, which then you can paste as much as you want, at least until something else is copied.

Here is my problem. I have VB script within the “Private Sub Worksheet_SelectionChange(ByVal Target As Range)” section of my worksheet. So every time another cell is selected this script is run. The script works perfectly and I do not need this changed. The spreadsheet first needs to be unlocked before the script can run, so I had to put this at the top of the script “ActiveSheet.Unprotect” and this at the bottom “ActiveSheet.Protect”. When I select a different cell and the code hits either the unprotect or the protect commands, then the copied cell border is no longer flashing, so I can’t paste.

Is there a script of some sort that I can use so it retains the copied data? The script should only run when a cell is copied. I also don’t want to use the SendKeys function because that typically causes more issues then what it solves. I have always been wondering where Excel stores its data for copied cells, since usually copied data is stored in the windows clipboard, or some other dumping ground since Windows 7 & 8 no longer use the clipboard for copping data. So I don’t understand why Excel doesn’t use the same method as everything else when a cell is copied.

Other information asked from the other sites:

What is the code that I am using: The code that I am using can be found at the below link. It is the one with the green checkmark as the answer, the one that I wrote. Although, for the most part it is irrelevant to this issue, other than knowing that when it hits the unprotect line, that is when it removes the flashing borders of the copied cell. For this script you see here, the unprotect wouldn’t be needed, but due to the fact that there is a lot of code in other locations of this spreadsheet I had to put the unprotect in there due to the spreadsheet being protected. If I didn’t unprotect it here, then the script would error out because it isn’t able to make changes.http://stackoverflow.com/questions/17005931/excel-2010-vb-script-highlight-row-issue

Clarification on how I am copying cells: Someone thought I had script to copy a cell from point A to point B. No, when I say copy I am just using the typical Ctrl + C on the keyboard. Due to the script activating as soon as another cell is selected, it prevents the copied cell from remaining active so I can never paste.

This isn’t too major of an issue since cells are very rarely copied in this spreadsheet, but just knowing the fact that it doesn’t work is driving me crazy, I like things to fully work the way they are supposed to. I would greatly appreciate it if someone knows of a solution to this.

Thanks,

Chris

Link to comment
Share on other sites

  • 3 weeks later...

Thanks grooveDexter for the page, it is somewhat helpful. I think what I need is a script that will pull the last copied (top) item from the Excel Clipboard and paste it in the cell when an item is pasted (Regardless if I use Ctrl + V, right click on the cell and select paste, or go to the home menu and select paste) . I can tell the copied cell is retained in the clipboard, even when I select a different cell and the border stops flashing; however I can’t paste that item in the desired cell unless I click on the item in the clipboard. I need to someone write a script that will retain the top item in the clipboard in memory somehow, so when I need it the paste feature will be available. Of course the item will need to be overwritten when something new is copied. I have no idea on how to do this, I even tried recording macros and that doesn’t help.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Steve
      Question from Reader - Email Form
       
       
      Hi Tom,
       
      Ouch. I know how it feels losing a days worth of work. The worst part is when you have to recreate what you've already done.
       
      To answer your question, when you found the Entry "OutlookSecureTempFolder" what was the path in the DATA column? I assume you reviewed this post here to find it. It looks like you found the registry key entry so your more than 1/2 way there. Find that key again and you should have the path to your OLK folder and your Excel should be sitting there.
       
      Now the path might be a bit confusing because with Outlook 2007, there actually is "NOT" an OLK folder. For instance, on my XP/Outlook 2007 install, my OLK folder or "Temp Outlook Folder" / "OutlookSecureTempFolder" is:
       
      c:\Documents and Settings\mrgroove\Local Settings\Temporary Internet Files\Content.Outlook\4V32TZLP  
      So if you look on your box you will find what your looking for in the "Content.Outlook" folder. Take a look there and your golden.
       
      More reading can be found here also on the Outlook OLK folder location:
      http://www.groovypost.com/howto/microsoft/outlook/find-the-microsoft-outlook-temporary-olk-folder/
       
      Thnx!
    • By micalhassey
      I want to best solution for recovering Excel sheet password because I don’t remember my Excel file password please any one suggest me to remove my Excel file password….Thanks
    • By shockersh
      Quick question for you groovy excel ppl out there. I'm working with a vendor and need to calculate the discount and/or increase. I know there is a simple excel formula I can use. Just looking for a tip for it.
      Thanks!
    • By Beyond_Life
      My dad wants me to make him a excel sheet with all different formula's in it. No problem, I can make those. But in the sheet, the first cells are used for a name from his client, and the second cell is used for a date.
      Q: Is it possible to make Excel use those to cells to create the filename of the sheet when it saves?
    • By Austin
      Beatrice writes:

      I have a question, I know how to do a data validation drop down but I need the one list with two buttons in the same cell and a range of years.Do you know how to do this?
      I work for the school district and they need a particular calendar. They have a cell where you can list the year but it list whole number with a range of 1999 to 2999 and has two buttons.... one to go up in years and one to go lower... Hope this makes sense
  • Who's Online   0 Members, 0 Anonymous, 4 Guests (See full list)

    There are no registered users currently online

×
×
  • Create New...