VBA: Copy and paste defined range as Values (123)

Lebene

New Member
Joined
Sep 20, 2019
Messages
40
Platform
  1. Windows
Hello everyone,

I need an easier way to copy cells within a certain range and then paste in the same range as values. It's just that once the cells are filled with info from the index/match, I want to paste it as values so that the values don't change (it's people records and they might move to another department or get a promotion so the details could change once I update the main people sheet).

How could I do this? I would need a navigation box to open that lets me input the range and when I click 'go' or 'run' it does that for me. When you're on <500 records it's easier to do it manually but as the records grow I keep forgetting where I was and having to 'show formula' and it gets arduous and opens up to more human error.

Thanks for any advice or help
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try this macro:
VBA Code:
Sub FixValue()
Dim myR As Range
'
On Error Resume Next
Set myR = Application.InputBox("Select Range to fix values", "select...", Selection.Address, , , , , 8)
On Error GoTo 0
If Not myR Is Nothing Then
    myR.Value = myR.Value
    myR.Cells(1, 1).Select
Else
    Beep
End If
End Sub
It will ask to select a range (default value is the current selection) and then set it with current values

Bye
 
Upvote 0
Solution
Try this macro:
VBA Code:
Sub FixValue()
Dim myR As Range
'
On Error Resume Next
Set myR = Application.InputBox("Select Range to fix values", "select...", Selection.Address, , , , , 8)
On Error GoTo 0
If Not myR Is Nothing Then
    myR.Value = myR.Value
    myR.Cells(1, 1).Select
Else
    Beep
End If
End Sub
It will ask to select a range (default value is the current selection) and then set it with current values

Bye
You're a lifesaver, thank you very much.

Bye
 
Upvote 0

Forum statistics

Threads
1,215,670
Messages
6,126,127
Members
449,293
Latest member
yallaire64

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