Copy and Paste Cell Value Only - Not Formula - from one sheet to another sheet

arnalba

New Member
Joined
Jan 11, 2010
Messages
3
I am only newly introduced to VBA code and macros, and am urgently looking for a solution. I would be really really grateful for suggestions in finding a solution to the code below!

The code copies a value from multiples sheets (same range/cell range) and pastes it into the current sheet (ResultsTable)

The cells being copied contains a formula.

Is there a way to copy a cell's numeric value only and not the formula? Or maybe paste the value only (like the Paste Special - Values Only menu item)


Sub cpypaste()
Dim ws As Worksheet
x = 0
For Each ws In Worksheets
If ws.Name <> "ResultsTable"

ws.Range("e108").Copy Destination:=Sheets("ResultsTable").Range("d6").Offset(x, 0)
ws.Range("g111").Copy Destination:=Sheets("ResultsTable").Range("e6").Offset(x, 0)
ws.Range("g109").Copy Destination:=Sheets("ResultsTable").Range("f6").Offset(x, 0)


x = x + 0
End If
Next ws
End Sub
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hello and welcome to the board!

Try use the macro recorder to get the format for pasting values. If you still have problems, post back...
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,986
Members
448,538
Latest member
alex78

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