VBA help - values not formula wanted

Myproblem

Board Regular
Joined
May 24, 2010
Messages
198
I wrote this code:

Sub eeeee()
Range("c1:c12").Select
Selection.Copy
Range("a1").Select
ActiveSheet.Paste
Range("h1:h12").Select
Selection.Copy
Range("f1").Select
ActiveSheet.Paste
End Sub

but it give me formula not values, what is wrong?
any tips
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try

Code:
Sub eeeee()
Range("C1:C12").Copy
Range("A1").PasteSpecial Paste:=xlPasteValues
Range("H1:H12").Copy
Range("F1").PasteSpecial Paste:=xlPasteValues
End Sub
 

MrKowz

Well-known Member
Joined
Jun 30, 2008
Messages
6,653
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Try:

Code:
Sub eeeee()
Range("c1:c12").Copy
Range("a1").PasteSpecial Paste:=xlPasteValues
Range("h1:h12").Copy
Range("f1").PasteSpecial Paste:=xlPasteValues
End Sub
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,779
You are using copy and paste. If the source cells (C1:C12 H1:H12) contains formulas then pasting will put them in A and F.
You could try
Code:
Sub eeeef()
    Range("A1:A12").Value = Range("C1:C12").Value
    Range("F1:F12").Value = Range("H1:H12").Value
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,108,911
Messages
5,525,588
Members
409,652
Latest member
strangelyangely

This Week's Hot Topics

Top