Solved

Copying cells to another location

Posted on 2012-03-10
2
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

752 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