Make Copy / Paste Values Macro More Efficient When Calculating
Feb 17, 2014
I got a macro to copy and paste values onto another tab within my worksheet. I have a lot of data and currently takes about 30 seconds to calculate and paste. Not sure if its an issue with my macro or with my computer (Mac - Excel 2011).
Here is an example of my macro:
Sub SimulateWeek()
If Range("AdvanceWeek").Value = "Week 1" Then
Range("Week1B").Copy
Sheets("Schedule - Results").Range("C2").PasteSpecial Paste:=xlPasteValues
[Code]....
(this continues on until 'ElseIf Range("AdvanceWeek").Value = "Week 31"....etc). So you can see I have the same code repeated 31 times.
View 2 Replies
ADVERTISEMENT
Feb 27, 2010
I've tried to record macro, placed formula in row 4 only, copy and paste it to the end of row, and make it value. My database begin form column AM to BG.
Sub UPDATE_DATABASE()
'
' UPDATE_DATABASE Macro
' Macro recorded 2/22/2010 by FAUZAN
'
Sheets("database").Select
Range("AM4").Select
Selection.Copy
Range("AM5").Select.........
View 9 Replies
View Related
Apr 10, 2014
Any way of shortening the attached code. The first part 'Sub Loop1()' works great but I can't figure out how to shorten the second part. As you can see the distance between columns is always consistent i.e. add 5 columns to find the next outcome to work out the next result. Ideally I wanted to somehow loop through the next 5 columns again and again until the cell is blank.
[Code] ......
View 2 Replies
View Related
Jun 11, 2014
So I have two cells D15 and C15.
I simple want to copy there values (There paste links)
And paste them into the next blank row between D/E17/ and D/E26.
View 1 Replies
View Related
Nov 29, 2011
I am looking for a macro that will copy a worksheet to a new workbook and 'paste as values only' - this is because I already have a macro that I am trying to use to 'autofilter' the sheet to only show rows and colums that have entries in them. Since the sheet is dynamic, the macro will not work unless I copy and paste as values only...
Workbook attached - FYI, the 2 sheets in the workbook are actually in 2 separate books, I have just put them together to make it easier to post here...
View 3 Replies
View Related
Oct 13, 2009
I have an existing macro that copies a worksheet and pastes it into another workbook, renames it and then attaches it to an email. My problem is that it pastes just the values. I need it to paste part of the original worksheet as values and part copy the formulas. So on the new workbook Columns A through F will be values only and G through Z will copy the formulas.
View 10 Replies
View Related
Jan 8, 2013
I'm trying to use a macro that will copy & paste values from one workbook to another. Everything works fine until I try to get it to Paste to next available row.
It worked the first time, but after that it jumps, several hundred rows at a time.
This is what I have so far:
Code:
Sub CopyData()
Workbooks.Open Filename:="S:Production OfficeMonthly KPI Reports.xlsm", ReadOnly:=False
Windows("Weekly KPI Plan.xlsm").Activate
Worksheets("Data Input").Select
Worksheets("Data Input").[A4:AT650].Select
[Code]....
View 3 Replies
View Related
Aug 7, 2007
I need a macro that will take the values that are in the far right cells and move them to an area on the left. the columns they will be pulling from are the IU & IV column starting with row 2 down to row 460. from there I need the values to be pasted into the D & E Columns starting at row 6. The two columns IU & IV are a date and a task for that date. When they are pasted into the columns D&E they will need to be sorted by dates (or just all of the blanks removed), with the soonest occurrence at the top. The reason for pasting values is because I have formulas pulling the tasks and dates off of another sheet. The last thing is that the macro needs to be triggered by the information in cell c2, when that cell is changed the formulas go to work and everything in cells IU & IV update. That is when I would like the macro to kick in and work the miracle.
I have been trying to build a colony of formulas that could do it, but I have given up, then I tried to make an array index it for me, but that wasn't working for me either.
View 9 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
May 13, 2006
I'm using the script below to do a cut & paste job. The script works fine. However, since I have a lot of data on my worksheet, it takes a very, very long time to complete the job. Based on the same logic used in my script, could you propose a more efficient way of doing it?
Sub test()
Application. ScreenUpdating = False
On Error Goto errortrap
Do
Columns("d:d").Select
Selection. Find(What:="*", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
ActiveCell. Offset(0, 1).Activate
ActiveCell.Offset(0, -1).Activate
Selection.Cut
ActiveCell.Offset(5, -2).Activate
ActiveSheet.Paste
Loop
errortrap:
End
End Sub
View 2 Replies
View Related
Sep 18, 2009
I am trying to develop a macro that allows the user to copy and paste a set of date and time values, move them to the next sheet and increase the month by 1. I need help trying to find out how can I create a counter for the program to keep running without the need to reprogram the macros again.
View 14 Replies
View Related
Feb 16, 2010
I have a folder containing 40 single sheet excel workbooks and I would like to automate following tasks:
- Open each excel file (need to open the file so as to update it since it gets the data from another workbook through =formulas)
- Copy paste as values
- Save this as excel html in the same folder as original excel files (keeping the original file name)
- Close (original excel file should not be changed ie formulas should remain in place, only the html file will contain values)
- Since there will always be xHtml files with same name need the macro to replace the excisting file
My abilities with excel are limited to functions, no VBA knowledge other than finding ready codes and pasting them in the module.
Since this routine is to be run almost daily the macro should run all files, instead of one by one.
I just hope that I am not asking too much for excel to handle and I hope that explanation is clear.
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 2, 2009
I would like to create a list of all the sheet names I have in a given workbook. Is there a simple way to do this through VBA?
View 6 Replies
View Related
Jun 26, 2009
Sheet linked from external file, new data coming daily. How to copy Values of cells from B4 till B-empty to C column? The attached file has a properly displayed data.
View 3 Replies
View Related
Jan 21, 2009
I am trying to get the formulas to work on Sheet 3, the rows formated to percentages correctly, but they are not reading the totals in row 2 to make the formula complete. I also want this to run more than one number, I would prefer a range for example value >= 1.29 so that Sheet 3 shows all items less than 1.29.
View 4 Replies
View Related
Jun 20, 2013
Attached is my code, pay attention to the bold part. I want the sourceSheet to be copied as a sheet and pasted in the targetSheet (the Sheet2 of "NewBook") but I want it pasted asvalues. Here is the specific part which needs to be looked at...and below is the full code.
VB:
Set sourceBook = Application.Workbooks.Open(sourceFilename)
Set sourceSheet = sourceBook.Sheets("Current")
Set targetSheet = NewBook.Sheets("Sheet2")
[Code].....
View 9 Replies
View Related
Jan 12, 2010
Have two ranges:
Range("Master") 5000R x 500C
Range("Filtered") 5000R x 500C
1st Column in Master is a calculated trigger column that sets itself to the row number if it needs to be copied to the Filtered range or is 0. .
Currently using two loops:
Loop 1 Build Collection of unique row numbers from the trigger column.
Loop 2 Process Collection: range copying row values from master to filtered.
View 9 Replies
View Related
Nov 20, 2013
I have a file and i want to make an exact copy with only values and the layout.
I can do copy paste each sheet in the new file one by one. with first the values and then the layout.
But the file has lot of sheets so it would be great to find a faster way then do it one by one.
View 1 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
Oct 1, 2012
I have one workbook that needs two macros.
On the "Complete Backlog" tab of my workbook, I want users to enter in the requested information based on the column header. Then I would like a Macro attached to a button that says "Refresh" that the user would click after they have entered in all of the information. This macro should look in Column M (WIP Status) and if any of the cells say "Close", it should Cut the entire row from the spreadsheet(Ex. A2:M2) and Paste it into the speadsheet titled "Closed Jobs".
This is so that as jobs are closed/finished, they are removed and stored on a separate sheet. The items would have to be pasted so that it pastes into the next available row - not just on top of each other.
I also need another macro that i can put into a button that doesn't "delete" a row from the sheet, but just copies over to another sheet - so that there are two instances in the workbook.
If would look something like: If a cell in "Column G / Director" of the "Complete Backlog" speadsheet is equal to "Snodgress" then copy columns A-L of the same row to the spreadsheet titled "Snodgress" - of course skipping down the rows to the next blank row.
.....is equal to "Herr" copy row to "Herr" spreadsheet.
....is equal to "McCormick" copy row to "McCormick" spreadsheet.
and so on.
View 2 Replies
View Related
Apr 19, 2006
I have made spreadsheet that calculates my total cost of making ice cream mix based on ingredient costs of two variables (Van_Gal, and Choc_Gal), for example 550 gallons and 750 gallons respectively. The worksheet calculates the total cost of making the Vanilla Gallons and the Chocolate Gallons. I’m not a VBA or Macro wiz, and now I’d like to Make a macro that will allow me to make a “table” of calculated costs associated with different assumed Vani_Gal and Choc_Gal amounts and then print the values; and then go down a row and print the cost of another amount of Vani_Gal and Choc_Gals until some preset end has been reached. For example:
Van_Gal; Choc_Gal;TOTOutput;avg cost
550; 750; 1300; $4,000.00; $3.08
600; 700; 1300; $4,250.00; $3.27
Let’s say that I want to know what the tot cost and avg cost per gallon for various combinations of Vanilla and Chocolate Mix from 550 V and 750 Choc for various combos and have it increase in iterations of 10 Gallons (i.e. 560 Van and 740 Choc); Maybe I'd use a " loop" that repeats calculations and prints them for different combinations of Van/choc until 800 Gals Van and 500 gal Choc. Once I have a table of values, I could sort it and find an optimal production level (with the Minimum avg cost). how to make a macro that can crank out a table like this?
View 4 Replies
View Related
Mar 1, 2010
I've created an Excel 2007 workbook with about a dozen worksheets that are full of formulas and links to other workbooks, as well as conditional formatting that isn't backwardly compatible with Excel 2003. However, many people who want to see this workbook are still on Excel 2003. I need to recreate an Excel 2003 compatible workbook with the appearance and formatting of the original and have all the formulas and links converted to values. So, the final product will "look" just like the original without the conditional formatting, links or formulas. It will just have the look, colors and values displayed for all cells.
Essentially, I want a macro that will copy however many worksheets (1-n) are in an Excel 2007 workbook to a new Excel 2003 workbook. I'd like the worksheets to retain their label names as well.
View 9 Replies
View Related
Jan 22, 2007
I want to copy and paste from one sheet to another based on column a using a macro copy button.
E.g. if column a value = apple then copy that row into the apple sheet.
View 9 Replies
View Related
Dec 22, 2011
We have a workbook that we create each month that has one worksheet per day of the month, labeled 12_01_2011, 12_02_2011, 12_13_2011...etc. The pages are an empty template with formulas and fields in place that we simply copy and paste the results of an SQL query into. Presently, we are copying the page manually several times over, and then manually renaming the pages with the new dates for the upcoming month.
So, here is my question. Macro that I might use that would:
1) Make a copy of the template for each day of the month.
2) Label each page in sequence with the dates for the upcoming month.
View 4 Replies
View Related
Feb 7, 2014
By using a macro on the attached report I like to copy the row values named "Section Total" in red and and paste them over the values starting with "Aged Debt" in blue (the rest of the wording cahanges every month so "Aged Debt" is the key word for that row).
View 1 Replies
View Related
Jul 2, 2008
How can i use this code to make it working also on a range filtered
Sub CopyPasteValues()
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
End Sub
View 9 Replies
View Related
Apr 18, 2007
How do I tell VB to copy the values from whole row on one worksheet to the row with the active cell on another worksheet?
View 3 Replies
View Related
Aug 11, 2008
I paste cell information into cells already formatted to have certain colored backgrounds, ect. However, upon pasting the cell format from the copied cell is obviously applied.
Is there a way of locking the cell formatting so that I can paste information from a different cell, but the font/bground colors stay the same?
View 5 Replies
View Related
Jul 10, 2006
I want this macro to find in this case "406" in column A which is at the very end of the last block of 160 rows of information.
I then want it to move up 159 rows and copy 160 rows of information underneath the last block of information.
i.e.go to A5280 , then go to a5121, copy rows 5121:5280 to 5281.
It falls over on the very last line of code I can see A5281 selected but it won't paste....
View 9 Replies
View Related