Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default How to copy formatting when moving from cell to variable to another cell on another worksheet

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?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to copy formatting when moving from cell to variable to another cell on another worksheet

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

--
Regards,
Tom Ogilvy


"kls" wrote in message
...
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?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy cell from file with variable name hsg Excel Worksheet Functions 1 March 27th 09 08:12 PM
copy last populated cell (moving) to another cell robert morris Excel Discussion (Misc queries) 1 August 23rd 08 10:16 PM
Entire worksheet moves when moving from cell to cell Al Excel Discussion (Misc queries) 3 April 21st 05 12:56 AM
Moving active cell after copy T Pitts Excel Programming 6 October 17th 03 08:16 PM
Moving a row based on content of a cell to a diff worksheet Bruccce Excel Programming 3 July 31st 03 05:02 AM


All times are GMT +1. The time now is 07:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"