Copy & Paste Specific Number Of Times Based On Value
Jul 22, 2007
I enter a part number in "D1". The number of components required for that part number is returned in "G1" based on a VLookup. I would like a macro that will copy and paste the part number I enter in "D1" in the first empty cell in column "D" and will paste it once for each component (G1) required. For example, if the number of components required is 4, and the first empty cell in column "D" is "D10", I would like to paste the part number in cells "D10", "D11", "D12", and "D13".
I need to copy and paste the specific dates from the specific city that the user will insert in the "dash" sheet. Basically, I need the macro to read the city and range of dates that the user will type into the "dash" sheet and copy the columns "AA" to "AD" from rows specified by the dates input. Once it has been copied, it has to be special pasted just the value onto the sheet "1" beginning at location B2.
the the data will not be available as it is vlookups to another excel sheet that i have not provided. I have deleted the data, but you can pretty much put 1's everywhere.
I've searched for a solution on the board and the internet too but to no avail; I am trying to create a macro that will select the entire column based on a cell reference G1 which is infact a Date.
Column G to Column S are pre-defined with a specific Date in row 8. If the Date in one of these columns (G8 to S8) match with the Date in cell G1, say it finds a match with H8, then I want to copy the range F14:F2000 and paste as values in range H14:H2000. The possibility of a match found is limited to a single columns from G to S.
Basically, I need to copy and paste upon certain condition (references) and paste related-datas in another sheet corresponding with these references. Every references are organized by lines with indicators on columns.
In attached file, see: - worksheet ANALYSIS: * datas in E2, G2, D18, D19, D20, D21, D22 that needs to be copy based on reference in C2, * then need to find this reference in worksheet called GROUP SAVE, * and based on this reference, paste above cells value in corresponding "Indicators" column number
THEN, I will have to do pretty much the same with subgroup data. But I can figure out for this second step that request same manipulation.
I have about 10 rows of data that have columns of information describing computer hardware and pricing. There are 10 rows, because each row represents a different country and different tax rates and pricing changes per country. So each column of a row has a specific formula to calculate information for that row's country information. All these 10 rows of formulas are kept as a reference at the bottom of the sheet.
At the top of the sheet I need to have a drop down menu to choose a country and then it will automatically copy and paste the row of that country to the current row at the top.
Is there any easy copy/paste macro for such a thing?
The sheet I have attached has three tabs one is a master sheet another is the production input and the last is an engineering input section, I have coded the production input section to input into cells and email the engineers when they have a new job, the issue i have is with the engineering input.
The engineers can currently go into this sheet and input the job number onto the engineering input section and it will show them the current issue from the master sheet (I have already entered 1002 in it), what I want them to be able to do is input into the white sections below the description and when they click on update entry a macro takes the job number entered into B3 and saves the information onto the mastersheet in the correct column/row which corresponds to the job they are updating.
However the engineers may need to go into the same job several times and update different information therefore the fields need to not paste into the cells if the input sections are blank.
Please see attached sample worksheet. Column A will be generated by the user manually.
I'm looking for a way in VBA to have A1:D20 in Sheet2 copied and pasted in the "Bank Reconciliation" Sheet based on how many "Markets" there are in Column A. Then, once that's complete to have A22:D30 (the smaller box in Sheet2) copied and pasted directly below those results.
I have what the macro would hopefully generate to the right in "Bank Reconciliation" (B6:E54) as an example. So if there's a market in A1, copy and paste the box to B6. If there's a market in A2, copy and paste the box directly below the first (B26) etc. etc. until it's done, then paste the smaller box directly below whatever the macro generates.
I have never built or used a macro before and need very clear step by step instructions. I am just assuming that a macro is the answer to what I am looking for but if there is a simplier solution that would be fantastic.
I need to be able to repeat a row of data a specified amount of times.
3 Yellow James 2 Green Mark 5 Purple Sue 1 Orange David
Needs to look like:
3 Yellow James 3 Yellow James 3 Yellow James 2 Green Mark 2 Green Mark 5 Purple Sue 5 Purple Sue 5 Purple Sue 5 Purple Sue 5 Purple Sue 1 Orange David
I am trying to create a formula that would provide a result a specific number of times based on a table in a seperate worksheet. Here is an example:
Person: # of times John 2 Joe 2 Frank 2 Jack 1
Based on an IF statement, the cell should bring back John, the next cell down should bring back John, the third cell should bring back Joe as John has reached his limit of 2, and have this repeat until all criteria that meet the IF statement have been met.
I have a form to collect employee details. If i give the number of employees in one form, I will throw another form to collect the employee details. If I give 5 in first form, then the second form should be thrown 5 times and get the details. If I use for loop, then all the 5 form are thrown at once.
i want to paste text for MB1 in column B like from MB1-1 to MB1-16 and MB1 2-1 to MB 2-16 because MB1 has 2 rows and 16 elements to repeat, for MB2 in cloumn B like MB2 1-1 to MB2 1-3 and MB2 2-1 to MB2 2-3 and MB2 3-1 to MB2 3-3 because MB has 3 rows and 3 elements to repeat like this i want to continue upto MB5
I am expecting like this
A B MB1 MB1 1-1 . . . MB1 1-16 MB1 2-1
and i would like to continue this for the rest of text in column A .Here i tried with commond button simple and now i am in position to paste text in a given range but not the way i am expecting.
I'm trying to create an "export" feature where certain data can be copied out to a new workbook. I want to copy out the following from the current workbook to a new one: Sheets("1TR").Range("C33:M999") to range("A1") in the new workbook and Sheets("1PL").Range("K33:K999") to range ("L1") in the new workbook.
The problem I'm having is that it is not just one copy/paste exercise, but two, and I don't know how to reference the new workbook as it doesn't have a filename.
I've attached below a small part of my code. I am wondering if there is a way to do this, without copying and pasting something 30 times, but using a loop instead. As you can see there are a series of productsNumbers (30 in total, but this example is for 3). Each productNumber is a string that is actually a 5 digit number, so it can be an integer as well, if it has to.
I would like to code below to loop for as many products as there may be. The way that I have it right now does not work - I feel that I am missing something small or that there is no way to do this.
I have a range A3:E70 where A3:E69 have the same formatting and the text in A70:E70 is bold. I want to copy-paste the entire range a number of times with a for ... next-loop. Actually, it's kind of a template system. I make the template A3:E70 and uses it a number of times.
Basically on the file below whenever there is data in column "type" I want excel to copy the "name" and "account" next to it. The whole file has about 80,000 rows. Spacing is not always one blank row between accounts. I am using excel 2007.
I am trying to create a graph that is conditional on two different columns. The first column is a date column, the second column has various categories. I want to show how many times each category appears per month. This database is continually added to so I wanted the formula to reflect the entire column range.
For example, let say I have 5 categories (Grapes, Apples, Peach, Pear, Banana). Column A would show a date (in a M/D/Y format) and Column B would list the fruit type. I want to show how many Grapes were input in January, February, March, etc. and then move on to show how many apples in each month, and so on.
I have a rand () which provides me a different number upon calculate. I would like to run a loop for 1000 times and take the value and copy and paste in a range.
The below sorta works, but at times it stops or doesn't work at all. I have a loop for the counter and the for each to place the value into the cell and have it run over and over and placing the value in the next cell underneath. I have the counter at 10 so I dont get stuck in some endless loop before I know it works.
Sub montecarlos() Dim MCs As Long Dim c As Range Dim lCount As Long Dim lNum As Long lCount = 0 lNum = 1 Worksheets("MonteCarlo").Activate
Code copies the first two columns of a many column table and pastes them at a certain interval (14 columns) to make transfer to a report easy. The problem is that the worksheets each have a different number of columns, but none more than 56 columns. The macro works wonders on the first sheet, but thereafter does not work at all. The first sheet has 27 columns, the second sheet only has 4 columns and the one after has 38 or something.
Public iMaleGroup As Integer Public iFemaleGroup As Integer Public iMaleAnimal As Integer Public iFemaleAnimal As Integer Public iMaleGroup1 As Integer Public iFemaleGroup1 As Integer Public StudyTitle As String Public SmallAnimal As Boolean
Dim Wrkst As Worksheet Dim wsName As String Dim wsSubject As String Dim wsNumber As String Dim rSummaryHeader As Range Dim MergedHeader Dim NextMergedHeader Dim HeaderRange Dim AddHeader Dim TableHeader Dim SumTableHeader Dim PasteRange Dim x As Integer Dim n As Integer Dim z As Integer Dim i As Integer
Is there a function that allows you to read column A for an ID (these may or may not include letters/numbers/"?", are non-sequential and are of variable lengths) and, if it is the first time that it has seen an ID column B will read "sample_1_arm_1", if its the second time it has seen an id it will read "sample_2_arm_1", etc? An example of what I am trying to do on a much larger scale:
I have created a userform with 4 textboxes and "ok" button. whenever I press OK I want it to copy TB1(text),TB2(number) and TB3(number) in the first empty row a number of times based on what is in TB4(number). however, each time it has to add 1 to TB2 and whenever (TB2+1) exceeds 5 then 1 is added to TB3 and TB2 start over from 1 again.