How to copy formatting when moving from cell to variable to another cell on another worksheet

  • Thread starter Thread starter kls
  • Start date Start date
K

kls

I am taking data from 15 different cells on one workbook and want to
move it to another workbook where the data from the cells is arranged in
a different order, so I can't "copy and pastespecial
paste:=ValuesAndNumbersFormat" in one move. I've taken the values from
cells in the first wrkbook & set them to individual variables, activated
the second wrkbook & progressed from variables to cells.

Is there a better way, when the data is not entered in the same cells in
both workbooks, not even relatively?
 
Dim rng as Range, i as Long, cell as range
rng = worksheets("Sheet2").Range("A1")
i = 0
for each cell in worksheets("sheet1") _
.Range("A1,B9,C13,D12,M21,A2,C5")
i = i + 1
cell.Copy
rng(i).Pastespecial xlValues
rng(i).PasteSpecial xlFormats
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top