Solved

Copying cells to another location

Posted on 2012-03-10
2
224 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now