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
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

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
24,205
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,487
Messages
5,831,978
Members
430,099
Latest member
rdhoy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top