I have a spreadsheet where i need to disable Cut but allow copy & paste. This must stop dragging and dropping and only apply to the workbook in question, i.e. if I CTRL-TAB to another workbook cut is re-enabled. I have used the following code
Private Sub Workbook_Activate()
enableCut enable:=False
End Sub
Private Sub Workbook_Deactivate()
enableCut enable:=True
End Sub
Public Sub enableCut(enable As Boolean)
Dim cBar As CommandBar
Dim cbCtrl As Office.CommandBarControl
With Application
If enable Then
.OnKey "^x"
.OnKey "+{DEL}"...................
I have the following challenge: In VBA I copy from a file (and the copied area goes on the clipboard). The clipboard contents is then copied into another workbook and worksheet. Closing the file (close workbook) from where I have copied, I get the question: "do you want to save the clipboard contents, etc., etc, " ending with the buttons YES or NO to be pushed. How can I disable this question in VBA.
I've have a tool/code that takes the screen prints of the active window (when I press F9) and pastes it in a word document.
But whenever I do copy some text or any other image and when I press F9 to take the screen print of the active window. I get the text pasted into the word, this is because the clipboard content has text first and then the screen print of the active window.
Instead When I press F9, I wanted the below to happen
1. Content from the Clipboard should be cleared
2. Take the screen print
3. Paste it in the word document.
Note: My tool/code already does 2 and 3. Looking for 1 alone, ,
I am on the final part of a visitor log and I am stumpped on how to finish it. I have a electronic signature pad (Interlink Electronics-ePad) that the controls will not allow me to use in VBA for excel, I can get the image and signature on my usersform but am unable to save just the image through any code.
All I have been able to come up with at this time is saving the userform and pasting it in the active worksheet (code for this I found here written by "Michel Pierron"). What I would like to be able to do is have the userform image cropped to where the "Image1" image is (Signature will be in it place when done, the OCX esign block will not show on upload) and then saved as "visitors name, date/time.JPEG" to a folder in my documents.
The attached file is a stripped down version of what i have so far with no checking involved, just trying to get the save part of this done. If all I can do is save the userform as a whole that would work also but would like to be able to change it to a jpeg for storage. Have tried to use epads SDK's to achieve a saved signature but haven't been able, was suppose to be on vacation this week but need to get this done before the 1st.
I would like to be able to open a template and save the contents of cell B19 as the file name.
Can I do this so i don't have to press a button to run the macro. I have only done one macro previously and that was with the help of people on this forum so don't get to technical.
If possible I would like to be able to save it on the server X: eportsoffender PDF's
I have an Excel invoice set up and working well. It does a bunch of things with macros - e.g. on save it increments the invoice number well as creates a jpeg screenshot for the invoice archives. I have added an additional worksheet (titled 'VAT') to the workbook. The new 'VAT' worksheet has five simple columns; Invoice no, Subtotal, VAT, M.O.T. and Total.
What I need:- On saving the workbook I would like to add a macro function that copys the final contents of the Invoice no (H2), Subtotal (C37), VAT (C38), M.O.T. (F38) and Total (I38) cells from the 'Sales Invoice' worksheet to the newly created 'VAT' worksheet in the respective columns. I would like this to be cumulative, i.e. continue to add the contents of the afore mentioned cells to the appropriate columns in the 'VAT' worksheet every time the invoice is saved. I would also like to have the Subtotal, VAT, MOT and Total columns summed and outputted in a cell of their own - but hopefully I can handle that.
How can I set the SAVE AS file name to equal A1's cell contents? (More specifically, when I need to rename an existing open file and place my cursor in A1 and hit Save As, I need to new file name to automatically populate A1's cell contents so I don't have to retype the contents of A1.)
I'm trying to clear the clicpboard using VBA so i don't get messages asking me what to do. is this possible and if so how? i could simply turn all alerts off but i rather not.
I am running into trouble with too much data accumulating on the clipboard in XL2007, so is there any way to set cutcopymode=false (or some other function) so that the clipboard is automatically cleared after every paste event throuout a macro project without having to restate cutcopymode=false after every paste?
I am looping through and copying screens of mainframe data and appending them to the clipboard. Once done, I start a Notepad and paste it for future massaging. Now I need to perform a check on each screen which requires copying something from the screen, assigning to a variable, and checking it. This overwrites what I've already stored on the clipboard. Is there a way to store what I've got on the clipboard, then use the clipboard for something else, and then reload the clipboard?
I'm currently opening up worksheets, copying the data there inside tables and pasting it over to a new worksheet which is basically the summary of all the data, unfortunately because I am moving large amounts of data, half way through the process I get a pop up asking me if I want to copy data to wherever to make sure it's stored or do I want to loose it, of course it's only a matter of hitting the no button to re-write the data so copy and paste carries on working but is there no function in VBA to clear the clipboard after every copy and paste, such as clipboard.clear, or something along those lines? Anything that will stop this message from appearing, I was my summary worksheet to work without popups appearing because then that would mean someone would have to sit there as it copies and pastes values, clicking no every time the clipboard gets full.
I recently installed Office 2002 onto a new computer and found that whenever I drag-and-drop any amount of data from one cell to another, a loud obnoxious noise plays when I release the drag-and-drop data.
I was using the same version of Office on my old computer and did not have this problem.
I'm guessing it's a clipboard issue, since when I open the Excel clipboard (where I currently have all options as unchecked) and copy something so it is captured there, the same noise plays.
I already have turned off Windows sounds via the Control Panel and have no clue how to turn off this sound.
I need a snipit of code that will paste the clipboard when the OK button on a message box (vbOkOnly) is pushed. I have in the past was able to make it stop if "Cancel" was selected, but one button seems to be harder for me.
I have a formula that will give me a phrase that I need to be able to paste into other applications - the value and not the "mid"s and the "search"s, etc. So, can anyone tell me how to take that formula's value and write it to the clipboard?
I have a file with Workbook Activate/Deactivate and Worksheet Activate/Deactivate commands in it. When someone is trying to copy information from or to this workbook the VB automatically clears the clipboard (or at least that's how I understand it), which makes it so they can't paste that data anywhere else. How can I prevent this, but still keep my current commands?
Sometimes I need to copy something to the clipboard, then go to another sheet (or somewhere). When I get "there", I sometimes want to insert rows, without "inserting cut/copied cells" . . . . So I end up saving the worksheet to clear the clipboard, then inserting my rows.
Can I insert blank rows while maintaining my clipboard?
I am using the following code in a template I have created for my department. I am copying a formula from the 7th row of the specified columns and want to copy and paste the row down to the "last row" which I have specified from an input box. I am trying to do this without using the clipboard, because some files are 50,000 lines or more and I want to speed this process up.
In the code where I have say Sheet4.Range("A8:I140000") I would like to use last row somehow like Sheet4.Range("A8:Lastrow")
I am copying information from a data extraction application called Monarch and then pasting it into Excel. The data to be pasted has to be inserted in between some existing data in the worksheet. Is there a way to count the number of rows in the clipboard so I can insert this number of rows into my worksheet then paste the data from the clipboard?
Is it possible for VBA to read data from a clipboard so that it knows what sheet to paste the data to? Currently we run a financial tool and 2 reports are ran and I put in a bottom so users could easily just paste special values into the correct place. Sometimes the users forget if they copied the balance sheet data or income statement data and currently its not a big deal because there are no columns to the right of where it is pasting so it isn't screwing anything up and they just delete the data and paste it to the correct sheet.
I have thought of 2 approaches I am going to take, but started to wonder if one could read the data from the clipboard before the paste.
My 2 options would be:
Option 1. Paste data to newly created sheet and check if it is balance sheet or income statement and then move from newly created sheet to correct sheet and delete newly created sheet. The user wouldn't see any of this because I would disable screen updating.
Option 2. Learn how to use Undo within my VBA or keep the Undo cache with items in it as it typically clears when VBA is executed. That way if they paste it and it is wrong I can just undo the VBA paste.
Option 1 I am confident I can handle. Option 2 I can research and feel I could do, but if it comes a time when a sheet has data I do not want to paste over then this option is no good.
I would like to hear any comments or feedback on this and if it is possible to read data off the clipboard so it knows where to paste.
My workbook has much copy and past from one sheet to another after a web query, eventually it freezes.
I suspected all along it had something to do with the Copy/Paste and the clipboard required to be absoultely emptied. The code I used to "clear the clipboard" is:
Declare Function CloseClipboard Lib "user32" () As Long Declare Function EmptyClipboard Lib "user32" () As Long Declare Function OpenClipboard Lib "user32" (ByVal Hwnd As Long) As Long
Sub ClearClipboard() OpenClipboard 0& EmptyClipboard CloseClipboard End Sub
But when I checked out some freeware in relation to clipboard viewers etc, it seems after running this code it does not absolutely empty the clipboard.
How can I empty the clipboard entirely or am I not constructing my work correctly ?
How to get the GetFromClipboard syntax from here working with my code (below), but am having a really frustrating time. Basically, I need to search for whatever value is copied to the clipboard (as you can see below which will be relative to a certain cell).
Here's what I have so far, and I'm trying to replace the contents of the What:="121212121" part of the Find method to look for the clipboard contents (a 9 char number) in another sheet (where a duplicate exists - the value I am searching will be a unique identifier for the incorrectly created duplicate record that needs to be deleted).
So, What:=<insert number/string on clipboard here>
My colleague copies a date to the clipboard and then pastes it back onto the same spreadsheet. The month and day reverse (01/12/2013 becomes 12/01/2013). This doesn't happen when copying 14/12/2013 (probably because it can't be interpreted two ways) nor when avoiding the clipboard with ctrl-C/ctrl-V.
My working theory is that it's some kind of autotext or formatting function. Is there a way to disable this feature/function/glitch?
I'm trying to implement a very simple macro to paste a set of cells - already copied to the clipboard from a CSV file - into a worksheet.
Basically, all I need it to do is to allow the user to open that other CSV file, hit CTRL+A and CTRL+C, then go to the relevant sheet in my workbook and run the macro, which should simply paste the copied data into that sheet (starting at cell A30).
Here's what I have so far - I keep getting an error when the macro reaches the ActiveSheet.Paste command.
VB: Sub UpdateData() ' ' UpdateData Macro ' Dim strSheetName As String
If the user clicks the button to do the paste special macro twice - the second time they get an error (I am assuming that the clipboard has been wiped clean and they need to go back and copy the data again). The specific error message is: "Run-time error '1004': PasteSpecial method of Range class failed".
What I would like to do is add code to the pastespecial macro that looks to see if there is something to paste - if not, I want to give my own message and not the default one.