Excel 2003 :: Paste Special As Values Macro Only Works Intermittently

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


ADVERTISEMENT

Paste Special As Values Macro Only Works Intermittently

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

Excel 2003 :: Macro To Copy And Paste Special Values From Different Workbooks Into One Workbook

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

Excel 2010 :: VBA Macro - Paste Special Values

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

Excel 2003 :: Unprotect And Protect Multiple Works Sheets With Macro?

Feb 25, 2008

I have an annual leave (vacation) work book with a summary page work sheet and separate work sheets for each month i.e. Jan, Feb, Mar.....to......Dec. In order to protect the formulas I have protected them by allowing only access to the input cells on each work sheet and the protect each work sheet.

When someone either joins or leaves the team I have to manually unprotect each sheet and protect again when I have completed the amendments to each of the 13 tabs.

macro code I would need to unprotect all the works sheets in one go (as I use the same password for all the sheets) and reset the passwords (protect) the sheets with more macro code.

I will be running the two macros from my own personal.xls file and ideally they would be fully automatic i.e. I would not need to input the passwords in to unlock or lock the work sheets as the password would be written in the code already

Excel version 2003

View 3 Replies View Related

Excel Macro To Copy Data From Array And Paste To Separate Sheet Paste Special Transpose

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

Conditional Copy/Paste Special Values Macro

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

Macro Works In 97 & 2000 But Not 2003

Mar 15, 2007

I convert text file into Excel. Then what I want is to look in column C for cell value “UNT:” (it is chopped word account: ) and copy value what is in the same row next column D into column K.

Then in column K copy down the value until next not empty cell.

My problem is that it works on Excel 97 and 200 but 2003 doesn’t work.

View 9 Replies View Related

Paste Values From Another Worksheet (paste Special, Values) In A Cell Which Is Lookup Value I Get #N/A

Jun 28, 2009

I have a little bit of problem with lookup function. When i paste values from another worksheet (paste special, values) in a cell which is lookup value i get #N/A. These values are numbers. When i put '7 for example i get the values i want from lookup table. I have a lot of these cells and its tedious job to put ' in front of every value. Is there a quicker solution?

View 3 Replies View Related

Excel 2003 :: Macro To Insert Cells When Paste Data

Jun 11, 2013

I have two spreadsheets in Excel 2003.

Spreadsheet 1 has 10 columns of data (A-J). I want to copy a variable number of rows from spreadsheet 1 to spreadsheet 2.

When I paste into spreadsheet 2, I'd like to automatically insert blank cells in three places, taking the total number of columns to 13. I'd like columns C, F and I to be blank, and the last column with data to be M.

I will perform this task regularly, and add the copied cells to the bottom of spreadsheet 2, so I'd only like to insert blank cells within the range that I'm copying, not the entire spreadsheet.

I will then populate the blank cells with a VLOOKUP function. Do I need another macro to automatically add the formula to the cells, or is there a way to include this in the cell-inserting macro?

View 1 Replies View Related

Excel 2003 :: How To Remove Characters To The Right Of Last Occurrence Of Special Character

Mar 30, 2011

I have a column of text where I need to remove all the characters to the right of the last occurance of a special character.

I think a process like reading from right to left, look for the first occurance of the special character, and return the characters to the left of this position.

If I can determine the position of the last occurance of the special character, I could use the LEFT function.

The SEARCH function is close. It finds the position of the first occurance of text inside text but it reads from left to right. I need to read from right to left.

Another approach is to examine each character one by one from right to left. If the character is not the special character, delete it. When the character is the special character, delete it and stop the process.

There is no consistency in the text. The total lengths vary. The number of times the special character occurs in the text vary. The number of characters to the right or left of the last special character vary.

I much prefer not to have the solution be some VBA because I need to share it with others who are even less capable than I am. We are using Excel 2003.

View 5 Replies View Related

Paste Can This Be Set To Default To Paste Special Values

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

Paste Special To 2007 From 2003 Shows: HTML, Unicode Text & Text

Oct 10, 2007

When I copy from Excel 2003 (values & formulas) and paste special into Excel 2007 i get the option screen to select unicode text,sylk etc instead of the other screen with the option of values,formulas,formats etc.How can I select the option for value,formulas?
Sorry cannot attach a screen shot as it is above the allowed limit.

View 9 Replies View Related

Paste Special - Values Only

Nov 4, 2009

Working in one workbook, I am using sheet 1 as a master form and copying it to the back of the workbook and renaming it.

View 3 Replies View Related

Right-Click To Paste Special Values

Nov 6, 2007

I have a person who needs to be able to copy and paste values very frequently. She would like me to set up a personal macro on her PC that will allow her to be able to right-click in a cell and have a context item that is paste values so she does not need to go to the paste special dialog continually.

E.g: She selects a range from one workbook and copies it, She then selects a cell in a second workbook and pastes the values into the second workbook. She does not mind pasting the formatting, but she does not want to paste the formulas as there are many named ranges in the formulas and if she inadvertently pastes everything, all of a sudden the next time she opens her second workbook there are links to the first. All she wants in the second workbook are the values, not the formulas.

View 9 Replies View Related

Paste Special (VALUES) Button

Dec 21, 2008

I want to put a button on a sheet that will paste special (VALUES) from the clipboard into whichever cell is selected.

What code do I use? I'm using Excel 2007

View 13 Replies View Related

Paste Special Values Not Working

Mar 14, 2011

I am trying to copy a range of cells and Need to transpose the values. Easy Enough? When I right-click and paste special, it gives me a new window with an array of options but not the standard Paste special value screen. I have used the others in the past and just pasted text. However this does not give me the paste transpose option which is what I need.

I am sure this is a User error where there is something about the way that I am copying this information but I am Drawing a Blank...

View 7 Replies View Related

Force Paste Special Values

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

Paste Special Values In Inputbox

May 14, 2007

I have a macro that should allow users to change a certain range to values, but I have problems with that last piece. Can anyone tell me what the command is to paste the range as values?

Sub Change_Range()
Dim UserRange As Range
DefaultRange = Selection.Address
On Error Goto Canceled
Set UserRange = Application.InputBox _
(Prompt:="Change Range to Values:", _
Title:="Range Change", _
Default:=DefaultRange, _
Type:=8)
UserRange.Copy
UserRange.PasteSpecial
Canceled:
End Sub

View 9 Replies View Related

Paste Special Values Based On Date

Oct 31, 2011

I have a workbook which contains lots of formula and is therefore very large (about 70 mb). The sheet pulls information from field instruments every hour of every day for the entire year.

I want to write a macro, that loops through a range (B5:B8764) and copies the entire row if the value in column B is less than =NOW() - 7 days. The copied rows should then be pasted with values only exactly where they were located e.g. row 5 should be pasted back to row 5 the only difference being only the values will be pasted.

View 2 Replies View Related

Copy Worksheet And Paste Special Values

Jan 4, 2012

I have a perplexing problem. I created code to copy a worksheet that has the correct page setup and then copy/paste special to get just the values, not the formulas from the master sheet. It works standalone - the copied worksheet after doing the paste/special just has the data along with the master sheet's original page setup. When I include the code within a For Each... loop, it only copies the worksheet and I get the formulas. What is different between the two approaches that would cause the loop code to not do the paste/special values?

Code that works:

Application.DisplayAlerts = False
Application.CutCopyMode = False
Sheets("PerfCompDashDistrict").Activate
Sheets("PerfCompDashDistrict").Select
Sheets("PerfCompDashDistrict").Copy Before:=Sheets("Store")

[Code] ........

Code doesn't work:

For Each DistrictCell In DistrictRange

Sheets("PerfCompDashDistrict").Range("c4") = DistrictCell
Calculate
Sheets("PerfCompDashDistrict").Activate
Sheets("PerfCompDashDistrict").Select
Sheets("PerfCompDashDistrict").Copy Before:=Sheets("Store")

[Code] .....

View 2 Replies View Related

Perform Paste Special As Values In Given Condition Using VBA?

May 16, 2012

create a macro to perform paste special as value function. First scenario.. IF cell A2 is equal to 1 copy paste special values in I2:J2 cells ( this cells are formula.. need to perform paste special to prevent it in updating)then IF A3 is equal to 2 copy paste special values in I3:J3 cells.same action till A31. Second scenario is if O2 cell has a value of 100% copy paste special as values formula in K2 cell, then if O3 cell has a value of 100% copy paste special as values formula in K3 cell.. same action till O31 cell. take note I manually input values in A2 TO A31 cells as well as on O2 to O31 cells. I want the macro to perform the paste special as values only when I put value in Cell A. and Cell O (CELL A and CELL O are not dependent to each other so they should function individually in the macro).

View 8 Replies View Related

Setup CtrlV To Act As Paste Special / Values

Jun 17, 2013

I have a few Excel files in use in my tv station's newsroom. The purpose is to allow Producers to enter text and then send that data to on-air character generators.

Here is the problem I'm running into: I have protected the sheets, which contain unprotected cells so the users can enter data....but if they copy something from a web page and paste it into the Excel file, that cell's formatting changes to include the html coding that was also (inadvertantly) copied.

How can I set up Control+V to ALWAYS act like "Paste Special/Values" so that only the text-content is pasted and the formatting of the cells in the my Excel files is not touched?

View 2 Replies View Related

Paste Special - Values To Delete Formulas.

Jun 30, 2006

Sub import()
On Error Resume Next
Dim wb As Workbook
Dim c As Range
Dim rngTo As Range

For Each c In Range("D1:D10").Cells
Set wb = Workbooks.Open(Filename:=c.Value)
With Workbooks("DigitalTicketMaster.xls"). Sheets("All")
Set rngTo = .Range("A" & .Rows.Count).End(xlUp).Offset(1, 0)
End With
wb.Sheets("Combined").Range("A2:C100").Copy rngTo
wb.Close .............................................
we have a change on our sheet, make it easy for our guys. Column A, is the date. Today 6/29.

They enter it once at the top, and it pastes for them automatically (a simple cell = $E$1)

But now, when I use the macro, it pastes over the formula that I don't want nor need, and have to call the second macro for. But then everything in that column shoes E1 on my new sheet, which is not the date... and each sheet changes dates, so I can't just have the date all the same.

What can I do in my original code to still make it loop, pull all my pages that I tell it to, but paste values only?

Would it be possible, in my loop, to highlight my cells, on that sheet... A2:C100, copy them, paste themselves right onto themselves, as values only, then copy over to my new sheet?

View 9 Replies View Related

Keyboard Shortcut For Paste Special Values

Mar 4, 2007

Is there a short- cut key sequence for paste special value short of: Alt+E+S+V

or

Writing a subroutine in Personal.xls and giving it a shortcut key like:

Sub PasteValues ()
Selection.Formula=Selection.Value
End Sub

View 7 Replies View Related

Paste Special Values And Formats WITHOUT Named Ranges

Feb 14, 2013

For some reason the following code, when executed, pulls a named range from the source workbook (sProj_Name). I feel like I have used this exact same code before and not encountered this issue. This named range is linked to the source workbook so if I save the file and re-open I get the wonderful 'would you like to update links' pop up. I cant figure out why, when I am forcing it to paste only values and formats, it is picking up this named range. In addition the source workbook has way more than one named range, so why it doesn't pull all instead of just one is a mystery to me as well.

VB:
With Workbooks(sProj_Name).Worksheets(2)
.Cells.Copy
Sheet2.Cells(1, 1).PasteSpecial Paste:=xlPasteValues
Sheet2.Cells(1, 1).PasteSpecial Paste:=xlFormats
Application.CutCopyMode = False
End With

View 2 Replies View Related

Copy And Paste Special Values For Non Contiguous Ranges?

Mar 18, 2014

I use to have a macro that could copy formulas from non contiguous ranges and paste the values in the same cells. So for example, I could select a non contiguous range like B5:B10, E10:F12, and G1:G10. The macro would then copy and paste the values in those 3 ranges, so those 3 ranges would be values instead of formulas.

I think it worked by storing each range and then looping through each range to copy and paste special values.

View 2 Replies View Related

Copy And Paste Special Values Issue/question

Jun 21, 2006

In the code below, I am copying information from a master sheet to various sub-sheets, but I cant figure out how, based on the way I have written my code, to copy and paste special values. I commented out the line that I need pasted special values.

Dim intData As Integer
Set wsData = Worksheets("Data")
LastRow = wsData. Range("A" & Rows.Count).End(xlUp).Row
Set wsCrit = Worksheets.Add
wsData.Range("E3:E" & LastRow). AdvancedFilter Action:=xlFilterCopy, CopyToRange:=wsCrit.Range("E3"), Unique:=True
LastRowCrit = wsCrit.Range("E" & Rows.Count).End(xlUp).Row
For I = 4 To LastRowCrit
Set wsNew = Worksheets.Add
wsNew.Name = wsCrit.Range("E" & I).Value
wsNew.Range("a3").Value = "Estimator"
wsNew.Range("a5").Value = "IP Number"
wsNew.Range("b5").Value = "Project Name" ......................

View 5 Replies View Related

Copy To Another Sheet, Rename And Paste Special Values

Jun 23, 2006

i would like to copy a sheet to another sheet, rename, copy and paste special values. but after the sheet is copied to another, the macro stops working...?

Sheets("Proposal").Copy After:=Sheets("Proposal")
'rename...
ActiveSheet. Name = "ProposalEmail"
ActiveSheet.Copy
ActiveSheet.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, skipblanks _
:=False, Transpose:=False

View 2 Replies View Related

Date Format Lost With Paste Special-Values

Oct 19, 2006

Using 26th January 2007 as an example

I have formatted a cell to show this as dd 26.

When I copy and paste it to another workbork where I needed it shown as a number it appears as 39108.

Is there an easy way to convert the Convert Date Format?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved