Is there a way to copy Find and Replace contents?

Tigerexcel

Active Member
Joined
Mar 6, 2020
Messages
493
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
As the title says can this be done? I've seen various internet posts that you select the data and then use Ctrl + C or some other copying method, as soon as I do that the actual contents are no longer kept and when I paste, there's nothing there.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You will need to provide more information on where to copy from AND where to paste
 
Upvote 0
Thanks shaowu.
Michael, the macro will need to copy all the cells actioned by the Find and Replace process onto a new worksheet.
 
Upvote 0
Rather than copy and paste. Why not simply write the new values to the required cells via VBA ?
 
Upvote 0
So, maybe like this
VBA Code:
Sub MM1()
Dim c As Range, n As Long
n = 1
For Each c In Selection
    Sheets("Sheet2").Range("A" & n) = c.Value
    n = n + 1
Next c
End Sub
 
Upvote 0
So, maybe like this
VBA Code:
Sub MM1()
Dim c As Range, n As Long
n = 1
For Each c In Selection
    Sheets("Sheet2").Range("A" & n) = c.Value
    n = n + 1
Next c
End Sub
Hi Michael,

I've copied this macro to the sheet required and it when i try to activate it, it is dimmed and won't let me run it, in fact it doesn't run in any sheet.
 
Upvote 0
Below is my code for multiple ranges copy and paste.
1) Ctrl+F find all cells you want to copy
2) in the result box, CTRL+A select all cells finded, close the Find and Replace dialogue
3) Run the macro and select a single cell, click OK.
please refer to my above post GIF for the steps.

VBA Code:
Public Sub MultiCopy(control As IRibbonControl)
    On Error Resume Next
    Dim SRange() As Range, UPRange As Range, TRange As Range
    Dim i As Long, AreaNum As Long
    Dim MinR As Long, MinC As Long

    AreaNum = Selection.Areas.Count
    ReDim SRange(1 To AreaNum)

    MinR = ActiveSheet.Rows.Count
    MinC = ActiveSheet.Columns.Count

    For i = 1 To AreaNum
        Set SRange(i) = Selection.Areas(i)
        If SRange(i).Row < MinR Then MinR = SRange(i).Row
        If SRange(i).Column < MinC Then MinC = SRange(i).Column
    Next i

    Set UPRange = Cells(SRange(1).Row, SRange(1).Column)

    Set TRange = Application.InputBox(prompt:="Select upper left cell of target range to paste:", Title:="Copy Multiple Selection", Type:=8)

    Application.ScreenUpdating = False
    For i = 1 To AreaNum
        SRange(i).Copy
        TRange.Offset(SRange(i).Row - MinR, SRange(i).Column - MinC).PasteSpecial Paste:=xlPasteValues
    Next i
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,982
Messages
6,128,104
Members
449,421
Latest member
AussieHobbo

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