Way To Force Paste Special Or Allow Users To Run A Macro
Aug 6, 2007
I have a sheet which is protected but people are still able to change cell formats etc if they use the standard paste method. I want people to be able to paste data in but it forces paste special values to stop people pasting formats etc over already formatted and locked cells.
I know I could write a macro and run it using the shortcut keys ctrl-v but then the users lose the ability to undo if they make a mistake.
Is there a way to force paste special or allow users to run a macro but be able to do undo if they make a mistake?
View 9 Replies
ADVERTISEMENT
Oct 26, 2006
I have a workbook where I want to retain FORMATS in all of my cells in all of my sheets, but allow the user to enter data. So I got this code to undo PASTE and instead do a PASTE SPECIAL VALUES:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim UndoString As String
On Error GoTo err_handler
UndoString = Application.CommandBars("Standard").Controls("&Undo").List(1)
If Left(UndoString, 5) = "Paste" Then 'Only allow Paste Special|Values
Application.ScreenUpdating = False
Application.Undo
Target.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.ScreenUpdating = True
End If......................
View 9 Replies
View Related
Sep 12, 2009
I have a spreadsheet that has a button named Exit Requisition Program on it to close the application with. When the button is used everything is wonderful. All of the data on the sheet is saved and the application closes. I have a problem with some users clicking the red X without saving changes and that creates a big problem.
What I need to do is any one of several things.
1. Remove the red X completely.
2. Deactivate the red X.
3. Have a message box pop up instructing the user to use the Exit Button when the red X is used. Any one of the three methods listed above would work for me.
View 2 Replies
View Related
Jan 29, 2014
I would like to implement specific cell ranges from two specific worksheets each within 33 workbooks (which all have several tabs) into a summary page in a separate workbook.
The cell ranges are going across my spreadsheet in rows and I would like for them to transpose into a columns depending on the data which I have separated by catergory on the summary page. They are all on the same location in each workbook which is separated by country. The cell ranges are E26:P37 and I would like to transpose them and have them put below eachother without overwriting for my format on the summary page, how I can put this together in a macro?
View 1 Replies
View Related
Feb 13, 2009
I have two CHECK BOXES, one says YES and the other says NO
directly after the user opens the worksheet and enables the macros
I want a pop up message box to appear directing them to check YES or NO and not allow them to do anything else until one of the two is checked
once either box is checked, they can continue on to filling in the rest of the worksheet
View 9 Replies
View Related
Sep 14, 2008
I have some simple Macro code that works fine for the COPY side of the action...
View 14 Replies
View Related
Nov 14, 2008
I have a macro that copies the main report sheet in my workbook. The point of the macro is to get a copy of the report data without allowing anyone to see the formulas/data behind it - when it pastes, it pastes only the values in the tables and then copies the charts, deletes the live ones, and pastes only the images back on the sheet. The macro works on my computer and my partner's computer, but not on anyone else's. It stops at this point:
View 5 Replies
View Related
Sep 16, 2009
I've got a sheet which has two column headings - Resources and Cost. I have another sheet which has the calculations for both of these. They are in cells H24 and D29 of the second sheet. I want to have a macro on the second sheet that if I click it, it will paste special these two figures (values only so no formulae), into the active cell on the first sheet. This is the code I've got so far but every time I run the macro it just pastes into the same two cells in the first sheet.
View 4 Replies
View Related
Feb 18, 2010
I have been using excel for years but have always managed to resolve issues using formula's etc but now i have had to step into the realms of macro's. I am slowly learning but urgently need help with the below problem which is bound to be a simple solution.
I have compiled a workbook for users to administrate on a daily basis. (each worksheet is a different day of the month but the same template) There are a few hidden worksheets as the info is extracted from these to run reports.
The issue/s i have is that administrators use cut, copy and paste to repeat data opposed to retyping, this messes formats, formulas and validation up. I have used a macro from the net to remove this option and it works fine. Problem is that if they do not enable macro's this will cease to be an option.
I understand that you cannot remove the option of enabling macro's but you can force. Again used a macro from the web that if you don't enable it only shows a welcome page saying that macro's need to be enabled to use. (all others are hidden) if macro's are enabled the welcome page disappears and the worksheets 1-31 reappear. Again this worked fine.
I tried putting both macro's into the same workbook but kept coming up with errors, each one i resolved led to another.
So short of it i need a instructions/macro to force macros and remove cut copy and paste.
View 14 Replies
View Related
Jul 23, 2009
I am having problems with 1 of my macro's and I am at a loss as to why!
I anticipate there is a simple answer and I apologize in advance, but....
This line of code is no longer working
View 6 Replies
View Related
Feb 27, 2007
I want to create a button in the toolbar for each time I open excel. I want to click the button and I automatically want the button to perform these three seperate actions: paste values, paste formulas, paste formats
View 9 Replies
View Related
Dec 6, 2006
I need to create a macro to "paste special - values", therefore I have coded
"Selection.PasteSpecial Paste:=xlPasteValues"
It works well if copy and paste special within the same excel sheet.
However, when I ctrl C on any other website and revert back to excel to use my macro to paste special, it cannot work.
View 9 Replies
View Related
Apr 30, 2008
I have a spreadsheet with 2 macros in it, one for copying cells and deleting contents/comments etc.
Selection.Copy
Selection.Interior.ColorIndex = xlNone
Selection.ClearContents
Selection.ClearComments
Application.CutCopyMode = True
and another to Paste Special (all except borders)
Selection.Select
Selection.PasteSpecial Paste:=xlPasteAllExceptBorders, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
The first macro works fine but the second macro comes up with a runtime error '1004' Paste Special method of range class failed.
View 2 Replies
View Related
Aug 9, 2009
I created a macro that copies a range from one worksheet to another as shown below, which correctly copies everything including formulas.
View 9 Replies
View Related
Aug 8, 2012
I have written the code below. And I found two problems:
1.The code stopped to work when I change from Paste to PasteSpecial.
Sub Copyfriction()
Dim DestWB As Workbook: Set DestWB = ActiveWorkbook
Dim DestWS As Worksheet: Set DestWS = ActiveSheet
Dim DestCLL As Range: Set DestCLL = ActiveCell
Dim UserChoice
UserChoice = Application.GetOpenFilename(FileFilter:="Text Files (*.xls),*.xls")
[Code] ........
2.As you see the right cell on the the destination sheet need to be selected. So Im planing to run the macro when double clicking the cell in question. I have tried the next
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Address = "$A$6" Then
Copyfriction
Cancel = True
End If
End Sub
View 1 Replies
View Related
Dec 14, 2011
I have a list box in a user form using R2:R3 as Row source.
I need to force the users to choose one of the items and not allow a blank entry to be entered.
I used the code below for the entries however it still allows for a blank to be entered into the Cell.
This part of the code works for Me.sapor = "" Or Me.jobna = "" Or Me.ordernu = "" But not for the next (2) list boxes it allows blanks Or Me.snd = "" Or Me.mcode = ""
Me.Snd and Me.mcode are list boxes.
Code:
If Me.sapor = "" Or Me.jobna = "" Or Me.ordernu = "" Or Me.snd = "" Or Me.mcode = "" MsgBox ("Feilds SAP Number, Job Name, Price, Code and Month Code Must be Completed")
Exit Sub
Code:
Private Sub CommandButton1_Click()
Dim rNextCl As Range
' Row count = where the select cell finishes and window box moves to rows over
' offset = howmany cells up or down from the row count
[Code]....
View 2 Replies
View Related
Mar 4, 2009
I have a workbook with many sheets in it. Within each sheet there is a cell with the Text "March 09" there are then 3 cells to the right of this cell with relevant information. Is there a Macro that can search for this text March 09, then copy this and the 3 cells to the right of it and paste special this information 1 cell below for all 4 cells.
View 2 Replies
View Related
Jan 20, 2012
Designing very simple macro, it simply trims of some bits from the spreadsheet.
I paste special the trimmed cells over the top of the existing cells.
The macro works fine on my computer.
I took the code from my computer and put it on the other persons computer. The macro didn't work claiming issue with the paste special.
View 7 Replies
View Related
Nov 9, 2012
Not sure if it's me or a new change in excel 2010, yet creating a simple macro as listed below does not work.
Outside of macro I will select a range of data and copy.
Then, using macro I'd like i to perform: paste special values, in the current cell
View 5 Replies
View Related
Jan 15, 2008
I have 9 worksheets in a book with sheets 1-8 used for data entry, and sheet 9 used for a weekly data upload. Sheets 1-8 are all formatted the same, they just represent different vendors. I need a macro to look through column F (invoice number) on sheets 1-8 and see if the value of each cell already appears in column c on sheet 9. If the value is not found and the row value for column M (sheets 1-8) is >0, I need to copy the data from columns D:K and paste special values into the next blank row on sheet 9.
Basically I'm trying to see if I've already paid an invoice, and if not then I need to automatically add the data for payment. I've tried to mess around with a VBA code myself and ended up with a migraine every time. I've also tried to use the advanced filter, but the cell values I need to copy over contain formulas and conditional formatting...not to mention I can't delete the data on sheet 9 that has already been added.
View 9 Replies
View Related
Jul 19, 2007
I am looking for a macro that can do one of two things. I am not sure which way I want to go with this yet and how automated it should be. Either scenario will result in a significant time save.
Scenario One
1. Copy & Paste Special Values on the selected/active worksheet
2. Protect Selected Worksheet with password "1234"
3. Delete ALL worksheets except the selected/active worksheet from the file. Names of other sheets can be various and are not static
For example:
A workbook has the following: sheets1, sheet2, sheet3, sheet_unknown_name
If you are working in sheet1 the macro would copy paste special values the entire sheet, protect sheet1 with the password "1234" and delete any and all other sheets.
Scenario Two
1. Copy & Paste Special Values on the selected/active worksheet into a new workbook
2. Protect the new workbook with password "1234"
3. Rename the new workbook with the original workbook name adding either "em_" to the front or "_em" to the end of the filename
4. File, Send To, Mail Recipient as attachment.
View 4 Replies
View Related
Feb 23, 2008
I often need to use Paste Special... Values, using Excel 2003. So I recorded a Macro into "Personal.xls" and assigned a shortcut key combination "CTRL-Shift-V" so that it would always be available. I first select one or more cells and hit CTRL-C to copy to clipboard, click on another cell, then hit CTRL-Shift-V to run the following macro: Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
It often works . . . and it often fails. When it is working it seems to keep working over and over. When it is failing it keeps failing. So it is almost as if there are two "modes" of operation, which for lack of terms, for this post I will coin the terms "fail mode" and "fixed mode". Once I am in one of the two modes, it stays there for a while. When it is in the "fail mode", I always get the dreaded: Run-time error 1004: "Pastespecial method of Range class failed".
Since this problem is very intermittent, I believe this is why there are so many posts in the Internet about this, and so many people are replying back "it works fine for me". I have seen many solutions offered but none work so far for just a simple shortcut key to do a PasteSpecial :Values. Some solutions "work" . . . such as adding the PasteSpecial button to the Toolbar, or pressing ALT-E-S-V <Enter> - but both of these bring up the Paste Special dialog box which I want to avoid. I spent days trying the many solutions offered but so far all I have found is a trick to convert Excel from "fail mode" to "fixed mode". The trick is to add a line to the macro to first do a "Paste Special: Format:
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
...................................
View 8 Replies
View Related
Jan 10, 2012
Can a macro make a workbook everytime you copy, it will paste special formulas only and skip blank rows? And can I still let me select the range manually? I would like to use this to link workbooks.
View 2 Replies
View Related
Feb 23, 2008
I often need to use Paste Special . .. Values, using Excel 2003. So I recorded a Macro into "Personal.xls" and assigned a shortcut key combination "CTRL-Shift-V" so that it would always be available. I first select one or more cells and hit CTRL-C to copy to clipboard, click on another cell, then hit CTRL-Shift-V to run the following macro:
VB : Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
It often works . . . and it often fails. When it is working it seems to keep working over and over. When it is failing it keeps failing. So it is almost as if there are two "modes" of operation, which for lack of terms, for this post I will coin the terms "fail mode" and "fixed mode". Once I am in one of the two modes, it stays there for a while. When it is in the "fail mode", I always get the dreaded:
Run-time error 1004: "Pastespecial method of Range class failed".
Since this problem is very intermittent, I believe this is why there are so many posts in the Internet about this, and so many people are replying back "it works fine for me". I have seen many solutions offered but none work so far for just a simple shortcut key to do a PasteSpecial :Values. Some solutions "work" . . . such as adding the PasteSpecial button to the Toolbar, or pressing ALT-E-S-V <Enter> - but both of these bring up the Paste Special dialog box which I want to avoid.
I spent days trying the many solutions offered but so far all I have found is a trick to convert Excel from "fail mode" to "fixed mode". The trick is to add a line to the macro to first do a "Paste Special: Format:
VB:
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Then select and copy any cell/s, click on another cell, and run the macro just ONCE - it will paste the formatted value successfully and you are now in the "fixed mode". Now you can remove the PasteSpecial:Format line that you just added, to get back to the original macro with just the "Paste Special: Values" line:
VB : Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Now Excel is in the "fixed mode" and the original macro will once again start working properly. BUT only for a while !! Then some time later, usually within a day or a couple hours . . . Excel goes back into that "mode" where once again the macro fails repeatedly. I have been unable to isolate what causes the mode to return to failure.
Any simple way to either change the code so that it ALWAYS is successful, why this often is not successful ? I believe that the fact that adding in the Paste Special : Format code and running it just once to fix the problem, also could be a clue as to what causes this problem to "sometimes" occur.
View 9 Replies
View Related
Nov 24, 2012
Copy over data from different workbooks and using paste special values to paste it into a new workbook using a macro. Here is what I have and what I am looking for:
My file path is
C:Documents and SettingsMy DocumentsProjectCostsDecember12
In this folder I have workbooks called:
Function1
Function2
Function3
In each workbook I have 4 worksheets
Cashable12-13
NonCashable12-13
Total12-13
GrandTotal12-13
I also have a workbook called DecMonthlyTotal in the same folder with the same named worksheets.
I am looking for a macro to be placed in the DecMonthlyTotal that will pull the data from the Cashable12-13 worksheets from Function1, Function2 and Function3 and paste special the values into workbook DecMonthlyTotal, worksheet name Cashable12-13, it will also pull the data from the NonCashable12-13 worksheets from Function1, Function2 and Function3 and paste special the values into workbook DecMonthlyTotal, worksheet name NonCashable12-13
Both the Cashable12-13 and the NonCashable12-13 have Columns A - G The row that the macro should start the copying from is Row 3 for each of the workbooks; however I don't have an end row for the workbooks as this will vary.
I am using Excel version 2003.
View 1 Replies
View Related
Mar 17, 2007
Paste can this be set to default to Paste Special Values only ?
I have a sheet with a number of lists validated drop down boxes. The sheet is networked and works fine.
Problem other users as they are entering information into the required cells they are copying and pasting. Then the inevitable occurs they paste data into the wrong cells the validation from the original cell is pasted as well. Is there a way I can set paste special values only to be the default for the full sheet.
Unfortunately we use excel 97 in the office.
View 9 Replies
View Related
Feb 23, 2010
I've tried to change the line highlighted in red to 'Sheets("Financial Accounts").Pastespecial After:=Sheets("changes")' but the macro crashes.
Sub ConsolidatedTotals()
Dim BeforeSheetName, NextPageName As String
BeforeSheetName = "changes"
NextPageName = "Financial Accounts - " & Worksheets("assumptions").Range("c3")
Worksheets(ActiveSheet.Name).Select
Sheets("Financial Accounts").Copy After:=Sheets("changes")
ActiveSheet.Name = NextPageName
End Sub
View 9 Replies
View Related
Mar 20, 2007
I got this code the other day
Private Sub CommandButton11_Click()
Sheets("Invoice Page").Select
Rm = 3
For c = 1 To 5
Rm = Application.WorksheetFunction.Max( Cells(1000, c).End(xlUp).Row, Rm)
Next c
Range(Cells(3, 1), Cells(Rm, 5)).Select
Selection.Copy
Sheets(" Records Page").Select
c = Cells(3, 256).End(xlToLeft).Column + 2
Cells(3, c).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
And instead of pasting the cells i want it to paste speical so it just pastes values rather than formulas.
View 5 Replies
View Related
Mar 26, 2014
copy content from particular cells in the current sheet to the next available row in another sheet. I need to Paste the Values as the cells I am copying are equations. It was working great until I tried using it again today. For some reason I get the following error:
Run-time error '1004':
Unable to get the Select property of the Worksheet class
Here is my code:
Code:
Sub CopyCampaignMetrics()
Range("A2:E2").Select
Selection.Copy
Sheets("Sheet2").Select("A" & Rows.Count).End(xlUp).Offset (1)
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
View 9 Replies
View Related
Dec 31, 2006
How would the code be changed below to be Paste Special Value?
The numbers copied are changing every few seconds and I want a snapshot of it.
im TheRow As Integer
Sheets("Loader").Range("C5:AC5").Copy
TheRow = Sheet2.Range("A100").End(xlUp).Offset(1).Row
If TheRow < 6 Then TheRow = 6
Sheet2.Cells(TheRow, 3).PasteSpecial
If TheRow = 6 Then Range("B6").Value = 0 Else Cells(TheRow, 2) = Cells(TheRow - 1, 2) + 1 / 24
Cells(TheRow, 1).Value = Date
ActiveWorkbook.Save
LastSoon = Now + 1 / 24 '1 hr from last time
Application.OnTime LastSoon, "Capture" 'set up for next hour
View 9 Replies
View Related