Copying A Row And Pasting The Same Below It With Just Formulas
Feb 12, 2010
I have attached the file. The row being copied is row "X" for both buttons. I have 2 buttons in the same worksheet to copy a row and insert the copied row below it. I have this macro running for 2 different rows in the worksheet, assigned to the respective 2 buttons. See my code below.
I have code that "mostly" works great. I'm copying columns from one sheet to another sheet, but in different columns. I have unique code for each copy/paste. The source is mostly raw data. However, there are a few columns that are formula-based, and I'm having a problem. I've attached my code, and it works, but it takes 20 minutes to complete.
I'm very new to macros, but I think(?) I know enough that a data source with 2,000 rows and 30 columns shouldn't take 20 minutes to complete the macro calculations. All of the columns (copy and paste) in the code are pure data. The only exception is the column labeled "AI". Is there are shortcut, other than creating new columns in the source data sheet and pasting these results as values? I put the specific pieces of code that I'm referencing in bold.
I want to copy the current region on sheet 3 and paste that into sheet2 starting with cell E4. But I don't want to actually use the copy method. I believe there is a way to do this. I was thinking the following:
The idea I had was to simply state that cell E4 would be assigned the value of CurrentRegion on sheet 3. Is there a way to bypass the copy method?
I've got cells which change after I use Solver to do simulations, These cells after the calculation is run I'd lke to paste into a seperate sheet and row for example (in preparating of charting them for example)..
I would like to paste it as folllows for example... .. but problem is, let's say the below list are in column A of the new sheet, than column B would be the first output of the calculation in the other sheet, column C would be the second output from the calculation in the other sheet. and so on..
I don't know the first thing on scripting, but I'd like to click on button where the calculations are made which when clicked on ,will paste to the other sheet in this sort of manner below.
Each calculation will use another column.. so the script must recognise there is other columns to the left already filled, ie. B, C, D, E F, coresponding to the results of calculations already performed.
I have a graph, that I would like to be able to copy from one sheet and paste into another, is there away of doing this without dropping the data i.e. every time I copy and paste the graph clears, I don't want to copy the spreadsheet data as well as the graph is purely for a visual
I am creating a macro for a monthly report of inventory. When I filter out items and the copy and paste them to another sheet, how do I tell the macro to paste it in the next available cell rather than say A20? Because the report has a different number of items and filter results from month to month.
I would like to do a mass paste of this formula: =VLOOKUP(A23,A2:C9, 2) With the only variable that changes along the way (A24, then A25, etc). But as I paste, (A2:C9), the table array, keeps changing as well, to A3:C10, A4:C11, etc.
How can I prevent this and only have A23 change as I paste?
If I have a formula on Sheet2 which creates conclusions depending on data already existing on Sheet1 and then I need to paste the same formula on Sheet4 in order to get conclusions from Sheet3, then what can I do? Every time I am trying to paste the formula, it connects it with Sheet1 instead of Sheet3
In other words Sheet1: Data Sheet2: Extracted conclusions from Sheet1 data based on a formula Sheet3: Data similarly organized as in Sheet1 Sheet4: How do I extract the same conclusions, but this time from Sheet3?
The formula on Sheet2 is: =INDEX(Sheet1!$E$312:$E$5000;((COLUMNS($A4:B4)-1)*20)+1)
I would like to copy this formula from Sheet2, then paste it to Sheet4 and then to have it appearing as =INDEX(Sheet3!$E$312:$E$5000;((COLUMNS($A4:B4)-1)*20)+1)
I'm trying to write a macro that looks in cell A1:VGH1 for the text "Name:" within the row, then copy that cell and other following cells and paste into a new row. This macro can loop through the row until all instances of the text "Name:" and the following cells are on their own row.
I am having trouble with a project for school. The instructions are: (In Worksheet 1) Type Your Name. Now, begin recording a Macro. Copy and Paste your name from Worksheet 1 to Worksheet 2. Fill in the background and edit the font. End.
In my very crude code below....I would like to speed up the coding so by extracting data from some 800 CLOSED workbooks and pasting the data from Non-contiquous cells in an active workbook on one sheet. Can't seem to ge the = Excelmacro4 closed workbooks method to work so I went with opening each workbook, extracting data and then closing each workbook...way too slow.
Question 2. As the loop progresses...I would like to concatenate the text strings copied from the Source books Ranges G4 and G5 as they are pasted into a single cell in the destination workbook. Can't figure out how to either concatenate or xlpaste special in the coding.
Question 3. IF a user has a one of the workbooks OPEN, how do I copy that data as well other than On Error Resume Next?
Dim wbOpen As Workbook Dim wbDest As Workbook Dim WS As Worksheet Dim i As Long Sub GetdaData() Application.ScreenUpdating = False Application.EnableEvents = False
I have multiple customers in a list that I would like to create individaul tabs for each, with customer name and store #, and at the same time utilizing my sales sheet template for all customers. Is there a way to do this without copying and pasting one by one.
I have a main worksheet with several categories in column A. I would like to set up an IF statement VBA macro, where by if cell "A2" = XYZ, then copy entire row 2 to worksheet XYZ; if cell "A3" = ABC, then copy entire row 3 to worksheet ABC, etc.
I have been asked by my manager to make new shelf labels for all our stationery products for the VAT change in the new year. I'm sure I can get excel to help me make the task quicker but i'm just having trouble with pasting the formulas into the label template that I have to use, I was wondering if anyone could tell me why and if it is possible to do with the way I set the document out. Attached is what I have so far.
if there is a simpler way of doing this. The data sheet is the item description and the old price. The labels sheet i need to be able to print off in that format so i can cut it up and use the labels on our shelves. The formula for the VAT change is on the labels sheet, it works on the old price on the data sheet. I want to be able to quickly apply the formulas and format of the labels to more cells in the sheet so i can print off multiple pages of labels.
I have tried just copying the current formatted cells (A2 to C29) which I have seperatley typed the formulas into (takes ages) and pasting them beneath that. It doesnt continue the formula though. Instead of the next label cells formula carrying on and being Data!A43 it become Data!A29. Perhaps what I want to do is not even possible!
I am trying to copy data from an employee worksheet into a database that tracks the history of that data when they click submit. Everything is working well, except I can't figure out how to change the code to copy and paste values instead of the formulas.
I have created a daily operating room schedule in which each time slot has a drop down box for the Doctor doing the procedure and the Group of doctors from which he/she came.
It is a yearly schedule with each day of each month duplicated on a tab for that month - the same daily schedule for each.
I have been able to duplicate each day right up until the 25th of the month in which I attempt to save the spreadsheet and am given an error stating it can not save some of the data, though the data appears to be intact (the validation drop down lists)
Upon closing and reopening the spreadsheet, all of the cells that contain validation including and after the 25th of the month are simply gone.
I have attempted to attach a copy of the file but I keep encountering an error with the database.
So, I have a document 25 pages long. It has 26 sections (1-26) and each section has up to 10 (.1 - .10) sub sections which contain 16 (a-p) sub-sub-sections. There are 6 columns of varying widths. Some cells, in a row, merge into adjacent cells.
I would like to break this document into 26 documents - one for each section - so that I may recombine and regroup them in the future incorporating a few modifications. Whenever I copy and paste to a new Workbook, I loose the formatting of column widths. Resetting these alone takes lots of time.
I have come up with is to duplicate the entire document and delete everything above and below the section I would like to save. Then repeat for next section. There's got to be a better way?
I am having some trouble with the "mid()" function. I have it saved as a variable which pulls 6 digits from another variable. I was trying to paste from the mid variable into my excel worksheet but it keeps on telling me that there is an object required error.
The goal is to input the "mid()" output in my code into a cell in the spreadsheet.