ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find and copy in macro (https://www.excelbanter.com/excel-programming/291906-re-find-copy-macro.html)

Tom Ogilvy

Find and copy in macro
 
Dim sStr as String
Dim oFind as Range
sStr = "recived"
Columns(1).Find("Report Total")
If Not oFind Is Nothing Then
oFind.Offset(0,1).Copy _
Destination:=Worksheets(sStr).Range("C10080")
End If

if the worksheet is named received, wth the normal spelling, or with the
other alternate spelling you used, "'recieved" then adjust the assignment of
sStr to reflect the actual name of the worksheet.

--
Regards,
Tom Ogilvy




"Duncan J" wrote in message
...
Hi,
I have two spread sheets. One called DHL and the other recived. I want to

find the word report total in DHL and copy the cell to the right of that and
paste it to the recieved worksheet C10080. I've been trying the
Set oFind = Range("A:").Find("Report Total")
If Not oFind Is Nothing Then
oFind.Resize(1, 3).Copy _
Destination:=recived ("recived").Range("C10080")
End If

Thanks,DJ




Duncan J

Find and copy in macro
 
Thanks Tom


All times are GMT +1. The time now is 11:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com