Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Copying cells to another location

Posted on 2012-03-10
2
Medium Priority
?
232 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

877 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