Solved

Copying cells to another location

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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.

630 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