copy data from macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using excel to enter conditions that would then be put into a series of
equations to leave me with a new set of data. Ideally I would like to be able
to use some type of macro that will allow me to take both the data I enter
and the data that results and put it on a new sheet. Is there anyone that
could help me to do this? I am currently using 2000, but have access to do it
in 2003 if it is easier or if someone is more familiar with that instead.

Thank you.
 
Let's assume that your input data is in cells G1:G10, and your final output (the new set of data) is
in cells Z1:Z10, all on Sheet1. This code will copy those cells and paste them as values onto a new
sheet, keeping the formatting as well.

Dim myR As Range
Set myR = Worksheets("Sheet1").Range("G1:G10,Z1:Z10")
Sheets.Add Type:="Worksheet"
myR.Copy
Range("A1").PasteSpecial xlPasteValues
Range("A1").PasteSpecial xlPasteFormats

HTH,
Bernie
MS Excel MVP
 
Back
Top