I have commented out the original select.copy (as this is the action the
user now takes). Any ideas?
Sub PasteFormatValues()
'
' Range("C10:F10").Select
' Selection.Copy
' Range("C13").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Application.CutCopyMode = False
End Sub
Thank you,
Frank Hayes
By commenting out those lines Excel doesn't know where to paste the
data or, if the user has not added something to the clipboard via Ctrl-
C, what to paste. It's not ideal but why not ask the user to select a
range and then run the code as below?
Sub PasteFormatValues()
Selection.Copy
Range("C13").PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= False, Transpose:=False
Range("C13").PasteSpecial Paste:=xlFormats, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
' You may be able to combine the two lines above into the one
below
' Range("C13").PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Mike F
"Frank Hayes" <hay...@verizon.net> wrote in message
news:O1x%23WF95H...@TK2MSFTNGP04.phx.gbl...
Sub PasteFormatValues()
'
Range("C10:F10").Copy
' Selection.Copy
Range("C13").Select
Selection.PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, _
Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
Application.CutCopyMode = False
End Sub
Frank
<stj...@hotmail.com> wrote in message
news:1188134279.1...@50g2000hsm.googlegroups.com...
Sub PasteValues_SkipBlanks()
' Macro edited 9/2002 by DH
Selection.PasteSpecial Paste:=xlValues, SkipBlanks:=True
End Sub
I tried a reboot, but it still generates the "PasteSpecial method of
range class failed" error. How frustrating!
- David
I have tried to create objRange object and assign them and it works
sometime and fails others.
Also, I tried adding the line Worksheets("Daily Dashboard").Range
("C72").Select before the first PasteSpecial as to select the cell
first before pasting. Then I get the "Select method of range class
failed"
PLEASE HELP!!! Thanks in Advance!
Here is my code:
Private Sub cmdGetData_Click()
[Result1].Value = ""
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Worksheets("Calculation Sheet").Range("A39:A62").Copy
Worksheets("Daily Dashboard").Range("C72").PasteSpecial
xlPasteValues
Worksheets("Calculation Sheet").Range("C39:C62").Copy
Worksheets("Daily Dashboard").Range("E72").PasteSpecial
xlPasteValues
[Result1].Value = "Complete"
Application.Calculation = xlCalculationAutomatic
Sheets("Control Panel").Select
Application.ScreenUpdating = True
End Sub