i am trying to create a code in VBA that takes each tab of an excel files and paste everything in another file keeping the same formatting but without formulas (only values). Is there an easy way to do this ?
Asked
Active
Viewed 118 times
0
-
[`Range.PasteSpecial`](https://learn.microsoft.com/en-us/office/vba/api/excel.range.pastespecial), or [value transfer](https://stackoverflow.com/questions/24294923/how-to-copy-only-values-in-excel-vba-from-a-range), should be helpful here. – BigBen Jan 17 '20 at 15:37
-
you need to clarify more. Do you want to just copy each tab and place it into a workbook that is already made? Do you want each tab to copy over or do you want just the data in each tab to paste into 1 tab in a different workbook? – Ethan Jan 17 '20 at 15:41
-
Have a look at this, edit it to suit your needs, I looked at several answers posted on here to get what I wanted... So see> https://stackoverflow.com/a/40768023/4961700 – Solar Mike Jan 17 '20 at 15:42
-
@SolarMike - I generally try to suggest using the cell properties instead of copy/paste. `targetRange. Value = sourceRange.Value`, `targetRange.Font.Bold = sourceRange.Font.Bold`, etc. Copy/paste mucks with the user's clipboard. – SmileyFtW Jan 17 '20 at 15:54
-
@SmileyFtW Well, I am not a programmer and my target is to get it to work - it did and still does when I have 400 student exams to mark. So any suggestions for improvement are welcome. – Solar Mike Jan 17 '20 at 16:06