A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hello Andreas,
nope, the same error like before..
The same error, like my solution..
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
i use for copy & paste a worksheet the following Code:
With ActiveSheet.UsedRange
.Value = .Value
End With
Sometime ist works, sometime i get an error "1004" on the line .Value = .Value.
It is the same file.
I copy the complete file under a new name, but i got the same errors, sometime, sometime not.
Used with different Version (2013/2016) on different OS-Systems (Win7/Win10) and different HW (PC/TerminalClient)
Can anyone help me?
THX
Michael
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Please never use SELECT, SELECTION, ACTIVECELL, it is slow and error prone. Always refer to the objects directly.
Try the code below. If you get an error 1004 at
Set Ws = Sheets(Sheets.Count)
add the line
DoEvents
before that line.
Andreas.
Sub Test()
Dim Ws As Worksheet
Sheets("Muster").Copy After:=Sheets(Sheets.Count)
Set Ws = Sheets(Sheets.Count)
With Ws.UsedRange
.Value = .Value
End With
End Sub
Here is more Information:
...
Sheets("Muster").Select
Sheets("Muster").Copy After:=Sheets(Sheets.Count)
' This convert Formula to text
With ActiveSheet.UsedRange
.Value = .Value
End With
Sheets("Muster (2)").Select
...
I'm sorry, your code makes no sense to me.
It does not appear to do anything.
You are setting the value equal to itself.
Can you show us few more lines preceding this code so that we understand the code better?