PDA

View Full Version : Copy data from one sheet to new - but paste only values without formating and links



neboland
02-13-2021, 02:45 AM
Hi all,

This is my first thread.

I need help to solve next issue:
I want to copy data from one sheet to new - every time i press button (start macro) i will have pasted data in new sheet. Code i have is excellent and works:



Sub Macro1()
Dim ws As Worksheet
Set ws = ActiveSheet
Sheets.Add after:=Worksheets(Worksheets.Count)
ws.UsedRange.Copy ActiveSheet.Range("A1")
End Sub

what i want: When paste data in new sheet i need only values without formulas or connection. (when i click "refresh all", i dont want to change pasted values, just to change original table).

Thanks in advance

snb
02-13-2021, 02:57 AM
Sub M_snb()
with activesheet.UsedRange
Sheets.Add( , sheets(sheets.Count)).cells(1).resize(.rows.count,.columns.count)=.value
end with
End Sub

neboland
02-13-2021, 03:04 AM
Hi snb, this works perfectly :) thanks a lot, especially for the most fastest answer in world :D

neboland
02-13-2021, 04:47 AM
Sub M_snb()
with activesheet.UsedRange
Sheets.Add( , sheets(sheets.Count)).cells(1).resize(.rows.count,.columns.count)=.value
end with
End Sub

Hi again, i have some problems with query because i dont have formated values like table. When i start macro, got only values in range.
Can you propose code for same problem, but to keep table format without connections?

Thanks

snb
02-13-2021, 05:49 AM
what i want: When paste data in new sheet i need only values without formulas or connection. (when i click "refresh all", i dont want to change pasted values, just to change original table).
That's what you got.

Use https://www.deepl.com/translator to translate your question.