ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA to copy entire sheet data + formatting (https://www.excelbanter.com/excel-programming/289585-vba-copy-entire-sheet-data-formatting.html)

Nic@Rolls-Royce

VBA to copy entire sheet data + formatting
 
Hello!!

I am trying to copy an entire spreadsheet (which uses formula)
and paste into another sheet as paste values keeping all the
formatting, cell colour etc...

futhermore the vba needs to look for data down coloum 'G' and delete
any rows that do not contain any data.

The name of the source sheet is 'Question data'

and the name of the output sheet is 'text values'

All help would be appreciated


All the best

Nic @ Rolls-Royce


---
Message posted from http://www.ExcelForum.com/


Tom Ogilvy

VBA to copy entire sheet data + formatting
 
Do paste special twice, once with values and once with formats

Worksheets("Question data").Cells.copy
With Worksheets("Text Values")
.Cells.PasteSpecial xlValues
.Cells.PasteSpecial xlFormats
.Columns(7).SpecialCells(xlBlanks).EntireRow.Delet e
End With

--
Regards,
Tom Ogilvy



"Nic@Rolls-Royce " wrote in
message ...
Hello!!

I am trying to copy an entire spreadsheet (which uses formula)
and paste into another sheet as paste values keeping all the
formatting, cell colour etc...

futhermore the vba needs to look for data down coloum 'G' and delete
any rows that do not contain any data.

The name of the source sheet is 'Question data'

and the name of the output sheet is 'text values'

All help would be appreciated


All the best

Nic @ Rolls-Royce


---
Message posted from http://www.ExcelForum.com/




Nic@Rolls-Royce[_2_]

VBA to copy entire sheet data + formatting
 
Just a quick thanks for the code

All is well and it works very very well


:

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 09:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com