Solved

Copying cells to another location

Posted on 2012-03-10
2
227 Views
Last Modified: 2012-03-11
From the active.cell row, I have a need to copy some cells from this row to another location in the same sheet.  Whatever row the active.cell is in, copy the contents of column D, to cell D7 and the contents of column E to cell F7.  After this copy, I need to delete whatever that active.cell row was.  However delete this row effects a formula in the row above it in column B, so that formula needs to be fixed because after the delete, there is a #REF error.

Example would be if row 10 is deleted, B9 needs a new formula, if row 15 is deleted? row B14 needs a new formula etc.  The formula used is just an =j10 for the first example and an =j15 in the second.

How do I copy the contents of a cell to a different location, based on whatever the active.cell is.  Please advise and thanks. -R-
TimeTracker.xls
0
Comment
Question by:RWayneH
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 37706792
Sub copytotopanddel()
[d7] = ActiveCell.EntireRow.Cells(1, 4)
[f7] = ActiveCell.EntireRow.Cells(1, 5)
[f7].NumberFormat = ActiveCell.EntireRow.Cells(1, 5).NumberFormat
ActiveCell.EntireRow.Delete
If IsError(ActiveCell.EntireRow.Cells(1, 2).Offset(-1, 0)) Then
ActiveCell.EntireRow.Cells(1, 2).Offset(-1, 0).FormulaR1C1 = "=r[1]c10"
End If
End Sub
0
 

Author Closing Comment

by:RWayneH
ID: 37707834
Thanks for the help.  -R-
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question