copy formule

verluc

Well-known Member
Joined
Mar 1, 2002
Messages
1,451
I have a sheet with in column B1:B5000 stock prices.In each of these cells there is the same formule.Now I want a macro that automaticly makes a copy from all these formules from column B to column C and the formules in column B deleted.
Have anyone such a macro?
Thanks
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
How's this:

Sub theCutter()
[b1:b5000].Cut Destination:=[c1]
End Sub

Hope this helps.
 
Upvote 0
On 2002-03-19 12:52, NateO wrote:
How's this:

Sub theCutter()
[b1:b5000].Cut Destination:=[c1]
End Sub

Hope this helps.

Thanks,it works, but the question was that only the formules must be deleted.The values
must be intact.
Have you a solution on this?
 
Upvote 0
Hi
You could give this a try

Range("B1:B5000").Copy
Range("C1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("B1:B5000").Select
Application.CutCopyMode = False
Selection.SpecialCells(xlCellTypeFormulas, 23).Select
Selection.ClearContents
End Sub


Or, if you mean you also want to convert the formulas in column B to values as well, then:

Range("B1:B5000").Copy
Range("C1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("B1:B5000").Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End Sub


Regards
Derek
This message was edited by Derek on 2002-03-20 01:30
 
Upvote 0
Hi


Try this method

Sub Doit()
Range("C1:C5000") = Range("B1:B5000").Formula
Range("B1:B5000") = Range("B1:B5000").Value
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,638
Messages
6,120,676
Members
448,977
Latest member
moonlight6

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