copying results to other location

C

Curt

With ActiveSheet
With .Range("X6")
.Locked = False
.FormulaHidden = False
End With
.Range("V17").copy
With .Range("X6")
.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "$#,##0.00"
Range("W6:W17").Select
Selection.ClearContents
The above code copies from v17 to x6 as it should
for some reason I cannot see why the following will not copy from x6 to v5
With ActiveSheet
With .Range("V5")
.Locked = False
.FormulaHidden = False
End With
.Range("X6").copy
With .Range("V5")
.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
.Locked = True
.FormulaHidden = False
End With
Can any one help?
Thanks in advance I am stumped
 
N

Norman Jones

Hi Curt,

The principal problem is that you are missing some End If's. Try this slight
adaptation:

'===========>>
Sub Tester02()
With ActiveSheet
With .Range("X6")
.Locked = False
.FormulaHidden = False
End With
.Range("V17").Copy
With .Range("X6")
.PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:= _
False, _
Transpose:=False
Application.CutCopyMode = False
.NumberFormat = "$#,##0.00"
Range("W6:W17").ClearContents
End With
End With
With ActiveSheet
With .Range("V5")
.Locked = False
.FormulaHidden = False
End With
.Range("X6").Copy
With .Range("V5")
.PasteSpecial Paste:=xlValues, _
Operation:=xlNone, _
SkipBlanks:= _
False, _
Transpose:=False
Application.CutCopyMode = False
.Locked = True
.FormulaHidden = True
End With
End With

End Sub
'<<===========
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top