copy spaced cells to different spacing

On one tab I have formulae in every 4th row that I want to copy onto another 
tab where I want the same formulae every 2nd row.  The rows in between these 
formulae are not blank.  How do I best do this?

Derrick
0
AAA (19)
1/19/2009 7:26:07 PM
excel 39879 articles. 2 followers. Follow

2 Replies
523 Views

Similar Articles

[PageSpeed] 51

You can use code like the following:

Sub AAA()
Dim Source As Range
Dim Dest As Range
Dim LastCell As Long
Dim WS As Worksheet
Set WS = Worksheets("Sheet1") '<<< source of data
Set Dest = Worksheets("Sheet2").Range("A1") '<<< destination of copy
With WS
    LastCell = .Cells(.Rows.Count, "A").End(xlUp).Row
    Set Source = .Range("A1") '<<< first row
End With
Do Until Source.Row > LastCell
    Source.EntireRow.Copy Destination:=Dest
    Set Source = Source.Offset(4, 0) ' down 4 rows
    Set Dest = Dest.Offset(2, 0) ' down two rows
Loop
End Sub

Change the lines marked with <<< to values appropriate for your
workbook.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
    Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Mon, 19 Jan 2009 11:26:07 -0800, aaa
<aaa@discussions.microsoft.com> wrote:

>On one tab I have formulae in every 4th row that I want to copy onto another 
>tab where I want the same formulae every 2nd row.  The rows in between these 
>formulae are not blank.  How do I best do this?
>
>Derrick
0
chip1 (1821)
1/19/2009 8:24:56 PM
Thanks Chip, that does what I need, only how should the code be different to 
limit the selection to be copied to one column instead of the whole row?

Many thanks in advance,
Derrick

"Chip Pearson" wrote:

> You can use code like the following:
> 
> Sub AAA()
> Dim Source As Range
> Dim Dest As Range
> Dim LastCell As Long
> Dim WS As Worksheet
> Set WS = Worksheets("Sheet1") '<<< source of data
> Set Dest = Worksheets("Sheet2").Range("A1") '<<< destination of copy
> With WS
>     LastCell = .Cells(.Rows.Count, "A").End(xlUp).Row
>     Set Source = .Range("A1") '<<< first row
> End With
> Do Until Source.Row > LastCell
>     Source.EntireRow.Copy Destination:=Dest
>     Set Source = Source.Offset(4, 0) ' down 4 rows
>     Set Dest = Dest.Offset(2, 0) ' down two rows
> Loop
> End Sub
> 
> Change the lines marked with <<< to values appropriate for your
> workbook.
> 
> Cordially,
> Chip Pearson
> Microsoft Most Valuable Professional
>     Excel Product Group, 1998 - 2009
> Pearson Software Consulting, LLC
> www.cpearson.com
> (email on web site)
> 
> 
> On Mon, 19 Jan 2009 11:26:07 -0800, aaa
> <aaa@discussions.microsoft.com> wrote:
> 
> >On one tab I have formulae in every 4th row that I want to copy onto another 
> >tab where I want the same formulae every 2nd row.  The rows in between these 
> >formulae are not blank.  How do I best do this?
> >
> >Derrick
> 
0
AAA (19)
1/21/2009 12:52:01 AM
Reply:

Similar Artilces:

DVD Copy Pro for Mac
[b]DVD Copy Pro for Mac[/b] is a DVD copy software that can support D9 to D5 compression. With simple operation, it can save DVD in four different ways including directly burning to DVD disc, saving as DVD folder, copying into DVD media format that can be played by DVD Player directly, and converting as ISO file for easy movie management. Now this cool Mac DVD Copy also supports the latest released Snow Leopard. You can download [b][url=http://www.dvd-copy-mac.net/download/dvd-copy-pro-mac.zip]DVD Copy Pro for Mac[/url][/b] freely right now. [b]More information:[/b][quote]http://www.dvd-...

Picture behind text in Cells
Is there any way in which a picture can be sent behind the text in the worksheet cells? Or round the other way, is there any way to show the cells contents in front of a picture? Many thanks Bezza Format\sheet\background should do the trick RES That is a valid command. Unfortunately I've got numerous different images that need to be displayed behind cells. I need to use the cells so that the values displayed infront of the different pictures can be used in forumula's. Bezza That is a valid command. Unfortunately I've got numerous different images that need to be displaye...

Display Cell
How can I display text, for example 1.98 x 106 x T-0.63 (1.98 x 10 to the power 6 x T to the power -0.63)? Hi select these characters in the formular bar and goto 'Format - Cells - Font' -- Regards Frank Kabel Frankfurt, Germany "Excelhelp" <Excelhelp@discussions.microsoft.com> schrieb im Newsbeitrag news:3B96F0D2-F8DA-4901-873F-3391273E3FE1@microsoft.com... > How can I display text, for example 1.98 x 106 x T-0.63 (1.98 x 10 to the > power 6 x T to the power -0.63)? ...

Can I "unlock" just one cell in a protected worksheet?
Is there any way I can unlock just one cell in a protected worksheet without removing the protection from the entire worksheet? I am working on a fairly complex worksheet that has 10-15 data entry cells. The rest of the worksheet contains formulas and informational text. I have the formulas pretty much debugged and working. I am now down to making mostly cosmetic changes to the text and formatting. I have marked all of the data entry cells in a different color to help me keep from overwriting a formula, but it still happens occasionally. I usually catch it right away and can recover with ...

Truncating cells
Hello, I have a spreadsheet full of student names (Last, First, Middle) each in a separate column. I need to shorten the Middle Name column down to just the Middle Initial (1 character). It would be nice to do these using a function rather that edit them individually. I've tried the truncate function but could not get that to work. Any suggestions? Thanks, Matt Verdill Greetings, You need to use the LEFT function. In a new cell, type this formula: =LEFT(A1,1) Where A1 is the cell with the Middle Name and 1 is the number of characters. James Walker, Jr. "Matt Verdill...

Extract numeric value from single cell
Hello, I have numeric values within a text string in a single cell. There i no conformity to the length, or the make-up of the text. There is only ever 1 numeric value (that may vary in length from 1- digits long) within the text string. I have used the find function, but is getting vary messy. Is there numeric wildcard character I can use. Im using Excel 2000 Any help would be much appreciate -- Landyma ----------------------------------------------------------------------- Landyman's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=807 View this thread: htt...

Import/copy calendar in Outlook 2003
I got a new computer and installed Office 2003, and wanted to move my calendar to the new PC. I created a new data file called Personal Folders from Old PC. I wanted to copy my calendar OVER my current one in Personal Folders, but don't see a way to do so. I can copy my old calendar into the Pesonal Folders, but can't delete the new, empty Calendar. So I have Calendar, and Calendar 1 under my Personal Folders. Any way to just import/copy my reminders/appointments into my new calendar? Thanks for any advice. Ck G'Day Cathy, 1. Use the Folder List 2. Click on the OLD Cal...

Copy info from one workbook to another?
I have a problem I have a workbook with the function i want like a discribe here. The problem is i want to split the workbook but i don`t know how. Is it possible to have a main workbook with information from other workbooks at each worksheet? I have 20 workbooks with information. I would like to have a main workbook with on sheet1 every row from the 20workbooks with category1, on sheet2 every row from the 20workbooks with category2, etc, etc. The information in the 20workbooks in always only on sheet. The Colum in which the data is has no fix end. I go to fill in the rows trough a...

Secondary Copy
Hi, My customer using Great Plains modified report(Primary Copy). Now he wants new report something similar to the modified GP report with very few changes. I tried to copy the modified report and planned to use us a secondary copy. But the report has temp tables, so I am unable to make secondary copy. Can some one help me in how to make a new report something similar to the modified report, where to launch it. Whether it is possible throught VBA & Modifier? Regards Selvakumar.S A report with a temporary table can only be a primary copy. This is because only a primary copy can b...

local copy of mail
How do you store a copy of all your mail on you local computer when using Exchange? You setup an OST/Offline Folders file. Check with your mail admin if they support that configuration. "Brandon Baker" <brandon@discussions.microsoft.com> wrote in message news:epNKuJ19FHA.4004@TK2MSFTNGP14.phx.gbl... > How do you store a copy of all your mail on you local computer when using > Exchange? > ...

Outlook 2000 SP3
How can I copy my mail and calendar to CD so that I can take my received and sent mail history to a new computer with Outlook installed? Thanks. >-----Original Message----- >How can I copy my mail and calendar to CD so that I can >take my received and sent mail history to a new computer >with Outlook installed? Thanks. >. > All your data saves in C:\Documents and Settings\Username\Local Settings\Application Data\Microsoft\Outlook\archive.pst and C:\Documents and Settings\Evgeni\Local Settings\Application Data\Microsoft\Outlook\outlook.pst You can either install instan...

Copy picture ossice wizard
I have project 2007 standard edition, but the button is not working at all? Any suggestions Hi, The wizard is IMHO useless. Go to Roport, Copy Picture and do without the Wizard what millions have done before the Wizard existed. HTH -- Jan De Messemaeker Microsoft Project Most Valuable Professional +32 495 300 620 For availability check: http://users.online.be/prom-ade/Calendar.pdf "Enrique" <Enrique@discussions.microsoft.com> wrote in message news:72B5AA6C-67AE-468D-B6AE-FF16F52E57BD@microsoft.com... >I have project 2007 standard edition, but the bu...

Copy and paste versus copy and insert copied cells
What is the difference between these commands? Try them, it is pretty easy to see the difference -- Regards, Peo Sjoblom "Alana" <Alana@discussions.microsoft.com> wrote in message news:879FED29-5541-41B0-BB2C-7108D42ED593@microsoft.com... > What is the difference between these commands? ...

Blank cells in graph
I have a a line graph that displays customer behaviour in a number of categories. The data source for the graph is a table that refreshes every time a different 'customer' is selected from a macro drop-down list above the table, drawing data from another table. All the blank cells from the table are plotted as zero on the line graph, and I can't seem to change it so that the blank cells are not plotted on the line graph at all. I've tried going to Tools>Options>Chart, but the 'Plot empty cells as' options are all greyed out except for the 'Zero' opt...

subtotal copy and paste
Hi I have used the subtotal option in Excel and this is fine. I have also collasped the list so only the subtotal for each category is visible. However I want to copy and paste this list (just the subtotal) into another sheet When I do this it expands and shows all the results. Is it possible to just copy the visible bit. I have looked in paste special but no luck Cheers Hager On Jan 21, 6:38=A0am, Hager <Ha...@discussions.microsoft.com> wrote: > Hi > > I have used the subtotal option in Excel and this is fine. I have also > collasped the list so only the...

Copy above fails one way, copy below fails another way
I have a table of blood pressure readings that looks something like this: A B C D E 11 12 Averages: 134 83 74 13 R# Date Sys Dia Pul 14 4 8/17/08 138 87 72 15 3 8/15/08 130 84 76 16 2 8/12/08 137 83 70 17 1 8/11/08 129 79 76 Cell A14 contains =A15+1 Cell C12 contains =AVERAGE(C14:C17) Cell D12 contains =AVERAGE(D14:D17) Cell E12 contains =AVERAGE(E14:E17) Every time I take a new reading, I want to add a row to the top of the table, between row 13 (the header) and row 14 (the previous top row). I want to push a...

time and date difference
I have a cell format of dd-mm-yyyy hh:mm that I have applied to "call open date and time" and a "call closed data and time" columns. I'd like to have a further column that calculates the difference in days and hours, or just hours, between these two date/time values. I can't seem to find a way to do it tho. I have tried DATEDIF but it doesn't give me the results I want (formula =DATEDIF(A1,B1,"d")) and I have seen examples of calculating the difference between time values but again, not what I want exactly. Is there a way to do this or do I have t...

Business Portal "Copy to Excel" not working in Query pages
Hi, I am using Business Portal 4.0. When browsing through one of the queries pages in Business Portal, i clicked "Copy to Excel" icon. I got an error saying "The Office Web Components (OWC) must be installed to copy results to Excel." at the bottom. I am using Office 2007 on my machine. I came to know that Microsoft Office Web Components will no longer be shipping in Microsoft Office. I tried installing Office 2003 Add-in: Office Web Components from http://www.microsoft.com/downloads/details.aspx?familyid=7287252C-402E-4F72-97A5-E0FD290D4B76&displaylang=en a...

Copying graphs
Hi Is it possible to range value a graph ie I would like to copy the graph to another workbook, show all the information but without the links? Thanks You could copy the chart as a picture, then paste it wherever you want. Select the chart, hold Shift while clicking on the Edit menu, Choose Copy Picture, and select the On Screen and As Picture options, then go to the other workbook/sheet and Paste. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Dixie" <Dixie@discussions.micr...

formula for cell
I have many cells with descriptive text, does anyone know of a formula where I can take for instance a cell with 500 characters and take only the first 30 and paste it in to a new cell. I have used a formula thanks to Gary =left(a1,len(a1)/2 which has worked for other uses I have--now I need to extract only the first 30 characters of a description and I have thousands of cells in my description column..Please Help =left(a1,30) Pete.Cornejo@gmail.com wrote: > > I have many cells with descriptive text, does anyone know of a formula > where I can take for instance a cell with 500...

How can I assign a data for one cell from another fixed cell?
I can assign data to one cell by put formular, for example: =H5. But if I add a row, my cell will get data from H6, Excel automatically modified my formular to: =H6 And now I want the data always come from =H5, no matter how many rows I add on top of it. PLease help me. I remember somebody did it, but I forget it. Thank you very much! If I understand your question correctly, you would use absolute references ($ signs to fix the row, column or both)... =$H$5 Rick "new Excel user" <new Excel user@discussions.microsoft.com> wrote in message news:BCAE5E50-1EAF-4ADA-9F24...

How do I change cell that contains a formula to an actual number
I would like to use the results of a formula in a cell as an actual number. Any help would be appreciated? Hi copy the cell and use 'Edit - Paste Special - Values' -- Regards Frank Kabel Frankfurt, Germany "Carlton A. Barlow" <CarltonABarlow@discussions.microsoft.com> schrieb im Newsbeitrag news:D8B1F514-E50A-4CB8-98B5-50D6FAA4B739@microsoft.com... > I would like to use the results of a formula in a cell as an actual number. > Any help would be appreciated? An easy way to do this is when editing the formula just type cntl+"=". It immediately chan...

Copying Views
Is there any way to copy the views under leads so that i can modify them and create different ones. I need to create 15 views and i do not want to do all of them one at a time. Even if there is a way to do it in sql i would love to know -- IT Manager It can be done in SQL, though it's unsupported. What you want need to do is use INSERT ... SELECT to copy rows in the savedquerybase, and give a different savedqueryid For a supported route you can use the CRM web service and create new instances of savedquery. The following article describes how to do this for the userquery, and coul...

Comparing two columns of data and Highlighting the Differences
I have values (mix of text and numbers)in column A and B. Each cell value in column B is also in column A. I want to highlight (Change Fill color to Red) for example) all those cells in column A that are also present in the column B. Any help writting a Macro will be highly appreciated. Thanks in advance. Harapa No macro needed. Select Column A's Data. Use Format/Conditional Formatting. Change "Cell Value Is" to "Formula Is" Assuming A1 is the active cell, enter this formula: =NOT(ISERROR(MATCH(A1,$B$1:$B$500,0))) click Format, click Patterns tab, select Red fill patte...

Having a go with assembly... how do I copy a double into a register??
I'm trying to speed up a maths routine which consists of much iterative multiplication (and adding and subtraction of ) doubles. Now if I declare my doubles as floats float f double d _asm { mov edx, f //ok mov edx, d //error operand size conflict Can someone show me the error of my ways??? Thanks "Si" <me@you.twang> wrote in message news:sm1gk0l60ng23gilu9b68hkcqi3ub9horn@4ax.com... > > > I'm trying to speed up a maths routine which consists of much > iterative multiplication (and adding and subtraction of ) doubles. > > Now if I de...