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

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try

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

Code:
Sub eeeee()
Range("c1:c12").Copy
Range("a1").PasteSpecial Paste:=xlPasteValues
Range("h1:h12").Copy
Range("f1").PasteSpecial Paste:=xlPasteValues
End Sub
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,759
Members
449,048
Latest member
excelknuckles

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
Back
Top