Copy Columns & Paste Mutiple Times At Intervals

Oct 12, 2007

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.


Option Explicit

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

Sub CommandModule()

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

Application.Calculation = xlCalculationManual
Application. ScreenUpdating = False ............................

View 9 Replies


ADVERTISEMENT

Sum Times During Multiple Intervals?

Mar 18, 2014

I'm trying to determine how much time our agents are spending for their lunch/breaks during 30 minute intervals. Range A8:A200 lists the agent's names, Range B8:B200 lists their lunch/break start times, Range C8:C200 lists their lunch/break end times, and Column E lists the times (8:00, 8:30, 9:00, etc.). If an agent starts their break at 10:57 (Column B) and ends at 11:10 (Column C), the value next to 10:30 (Column E) would have 0:03:00 and the value next to 11:00 would have 0:10:00. But would need to sum all the agents which took a break/lunch between 10:30-11:00, and 11:00-11:30.

View 2 Replies View Related

Grouping Log In Times Into 15 Minute Intervals

May 12, 2009

I have been given the task of finding out who logs in at what time of the day.

I have attached the raw data that I have to work with.

In essence I need to see how many login's there were for 06.00 - 10.00 at 15 minute intervals e.g:

06:00 - 5 Logins
06:15 - 1 Logins
06:30 - 3 Logins
06:45 - 11 Logins
etc

Has anyone got any suggestions?

View 6 Replies View Related

Convert Times Into Hourly Intervals

Sep 26, 2013

i have a s/sheet with thousands of times in a column (eg col1 below in 24 hour format) and would like these in an adjacent column in hourly intervals (eg in Col2 below

e.g.

Col1 ColB
00:23 0 - 1
02:54 2 - 3
09:07 9 - 10
15:24 15 - 16

Is there a formula I can run to enable?

View 2 Replies View Related

Copy/paste To New Workbook Several Times....

Jun 15, 2009

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.

View 4 Replies View Related

Copy/Paste 30 Times Or Loop?

Nov 18, 2009

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.

View 3 Replies View Related

Copy-paste A Range 5 Times?

Jul 31, 2012

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.

View 2 Replies View Related

Copy & Paste Cells Several Times.

Jan 4, 2007

I have an excel sheet, Data's range is B2:B5.

The data is listed as follows: Tom, Pete, Steve, Lisa.

I need a VB code to copy and paste the names (range) to J2:J17. By having the names pasted four times each.

The result would look like this:
Tom
Tom
Tom
Tom
Pete
Pete
Pete
Pete
Etc.

View 9 Replies View Related

Copy And Paste A Number Of Times

May 7, 2008

I have a task which I am sure can be done quite simply. I have a list of names in column A and a number in column B. I want a Macro to copy the name in column c, d, e etc for the number in column b.

View 9 Replies View Related

Copy And Paste Rows Multiple Times

Mar 20, 2009

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.

View 5 Replies View Related

VBA - Copy / Paste Cell 144 Times In Column

Mar 14, 2014

I have the price of S&P 500 in the L2 until L145 column.

And I would like to past each cell (L2, then L3, then L4....until L145) 220 times in column F.

As follow

L :
1780
1715
1680
.........(144 value)

TO column F

F:
1780
1780
1780
.........(220times)
1715
1715
1715
.........(220times)
1680
1680
1680
........(220times)

View 6 Replies View Related

Copy Range X Times & Paste & Format

Oct 9, 2007

I have a range of cells that is 10 rows high. I want to copy and paste this range 11 times while identifying each of the 11 copies of the range, such as; 02,03,04...12.

Please see attachment for an example of what I am trying to do.

Does anyone have an idea of how this might be done in VB?

View 3 Replies View Related

Count Number Of Times Specific Intervals Occur Between Relevant Values

May 5, 2008

I will say exactly what i want.

I want to keep statistics of roulette.

More specifically, i want to count how many times a dozen lates to come.

The range from 1-12 is 1st dozen, from 13-24 is the 2nd and 25-36 is the 3rd.

I want to count among these numbers, how many times one of three dozens appear every 1 time, how many times appears every 2 times, .... until 20 times.

For example: I have put in a column 500 numbers from 0 to 36.

The output must be like this:

1st Dozen: Every 1 time: x
Every 2 times: n
Every 20 times: m

The same for 2nd and 3rd dozen.

View 9 Replies View Related

Run A Loop For 1000 Times And Take Value - Copy / Paste In A Range

Sep 30, 2013

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.

Code:

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].....

View 6 Replies View Related

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".

View 2 Replies View Related

Calculate Mutiple Rows And Columns

Jan 8, 2010

I have 134 parts and each part is available in 5 price groups - these are static items that need no calculation as they are completed on another worksheet. I have 400+ "items" each item is made up of various parts. I need to calculate the cost of each item. Hard to explain without example so I have attached an example.

View 2 Replies View Related

Count Of Numbers Based On Value In Mutiple Columns

Apr 14, 2008

I would like to count how many 5's and 6's are in a column when the same row but different column is 7 and 8. For the example below the answer is 3.

4 7
4 3
5 3
5 8
6 7
6 7

View 2 Replies View Related

Find Maximum In Mutiple Columns & Delete All Values After

Dec 2, 2006

writing a macro to find the max value in each column and delete all the data points that come after it (or preferably: delete all the data points that come 2 rows down after the max, if possible). There will be many columns of data where the max will come at different positions in the column.

Instead of deleting post-max values, it would also be acceptable to just copy values from the beginning to the max to the same column in a new worksheet.

View 3 Replies View Related

Copy Columns Resulted From Another Columns Operations And Paste In New Sheet

Dec 30, 2008

when i copy columns resulted from another columns operations and paste in new sheet i got garbage ,could you tell me why and how to overcome this problem.

View 2 Replies View Related

Rearranging Columns With Intervals

Aug 16, 2009

I have posted earlier thread on similar problem but i did not get much response.I am really having a tough time to record a macro, where my columns will be selected with an interval and then will be pasted in to another sheet....

View 6 Replies View Related

Copy And Paste The Columns

Jul 19, 2009

I have one master sheet that I update daily from several other spreadsheets.Right now I'm having to manually place the columns side by side and copy the new data over. The column and row format are exactly the same for each of these spreadsheets. Each day we go out and collect data, just numbers. I then must copy the numbers to the master sheet. I cant just copy and paste the columns because in the rows that don't have data in them it will overwrite the previous days information with blanks. I've attached a sample with some dummy data in it. I only update data in columns G and H.

View 5 Replies View Related

Copy Different Columns And Paste In Particular Tab?

Dec 29, 2012

what i want in my code here is, i have 3 tabs in my attached workbook(product db, product export, invalid product).

In product db tab if Export column contain Y then that required info should paste in "product export" tab and only this columns(A,B,C,E,F,G,H,I,K) should paste

In product db tab if export column contain N then that required info should paste in "invalid product" tab and only this columns(A,B,C,E,F,G,H,I,K) should paste

to get this output i prepared code but it seems in longer way and make shorter to this code.

i make a separate lines for each column to copy and paste.

[URL]

View 4 Replies View Related

VBA To Copy And Paste To Different Columns

Jun 5, 2014

Is there a way to copy from one sheet to another but to different columns? For example, I want to copy the information from Sheet1 to Sheet2, starting at row 17 and leaving column C blank and pasting the information from Sheet1 column C to Sheet2 Column D?

I thought I could use something like this or with a combination using Unbound but couldn't get it to work.

Code:
Worksheets("sheet1").UsedRange.Copy Destination:=Worksheets("sheet2").Cells(Rows.Count, 1).End(xlUp)(17,

But how do you drop the info to the correct columns?

Sheet1ABC1EmployeeStartEnd2Bill3/8/20143/11/20143Bill6/5/20146/8/20144Dave10/2/201410/5/20145Debra6/7/20146/10/20146Michael1/2/20141/5/20147Rachael9/15/20149/18/20148Rick9/12/20149/15/2014Excel 2010

Sheet2ABCD16EmployeeStartEnd17Bill3/8/20143/11/201418Bill6/5/20146/8/201419Dave10/2/201410/5/201420Debra6/7/20146/10/201421Michael1/2/20141/5/201422Rachael9/15/20149/18/201423Rick9/12/20149/15/2014Excel 2010

View 8 Replies View Related

Copy And Paste Columns

Oct 8, 2008

I want to copy a column of values and blanks and past the values into another column without the blanks.

View 9 Replies View Related

100 Rows Of Data With 2 Columns - Calculate In Time Intervals

Dec 14, 2011

I have 100 Rows of Data with 2 Columns.

The left contains data input and the right Columns contains certain formula.

How do I set it up so that the worksheet can eg. Calculate 5 rows and rest 1 Second and continue this way until it reached the end of the rows? (Number of rows is not fixed).

View 5 Replies View Related

Copy And Paste Different Columns Into One Sheet?

Jul 7, 2012

I am trying to copy and past different columns from different sheets and copy them in one sheet which I named "BI Output Data".

VB:
'This copy and past the BI Result'
If CheckBox1.Value = True And CheckBox7.Value = True Then
With Sheets("AFA Output Data")

[Code]....

View 2 Replies View Related

Copy And Paste Hidden Columns

Dec 14, 2011

I am having a problem with hidden columns when creating a new sheet via VBA.

The source sheet has (4) columns that are hidden when this data is pasted to the destination sheet it ignores the four columns.

I need the destination sheet to be identical to the source sheet with the hidden columns.

As you can see in the code I have been able to hide the columns however the data is now in the wrong columns because the copied data excluded these columns. I tried hiding the columns before and after the paste with no success I'm thinking the issue lies in the actual copy portion of this task.

Code:

Sub E_MAIL()
'
' E_MAIL Macro
'
' Multiple_emails_and_Sheets Macro
'This is used for one sheet with multiple e-mails.
' ThisWorkbook.Sheets("NO").Copy

[Code] ........

View 3 Replies View Related

Copy Rows And Paste In Columns

Apr 30, 2013

I have Data in Row 1 beginning in Cell E1 then K1 (Every 6th Cell) About 300 Records with 5 Blanks between each one of them...

How would I get that Data In A5 Down Without the Blanks?

View 9 Replies View Related

Copy & Paste In Alternate Columns

Jun 23, 2006

I'm trying to copy and paste range in alternate columns from one worksheet to another. I can record this macro, but I believe it'll be really long because I have 21 alternate columns to copy and paste. What I'm trying to do:

-copy range B9:B41 in workbook 'Channel OU template' then paste values only in range BI9:BI41 in workbook 'final'
-copy range D9:D41 to range BK9:BK41
-F9:F41 to BM9:BM41
..and so on until the last column AP9:AP41 to CW9:CW41

Basically it's just simple copying and pasting from alternate columns. This is the really basic code that I have just for one column:

Sub copy()
Windows("Channel OU template").Activate
Sheets("sheet1").Select
Range("b9:b41").copy
Windows("final").Activate
Sheets("ou").Select
Range("bi9").PasteSpecial xlPasteValues
End Sub

View 8 Replies View Related

Copy Rows And Paste Into Columns

Jun 17, 2008

I am trying to save me a lot of copy and pasting. I have cells A1:A100+ with customer names listed out. I am trying to create a chart on a different page but on this particular chart, i need those customer names at the top of the columns going across the page instead of the rows.

View 3 Replies View Related







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