I'm looking to write an excel VBA macro to
I've tried various versions of
Cells.Find("New Member").Activate
ActiveCell.Offset(0, -5).Range("array1").Select
Selection.Copy
Range("????").Select
ActiveSheet.Paste
If aaa = "" Then
MsgBox "nope"
Else
Range("G5").Select
ActiveSheet.Paste
My vba excel macro skills are very new. Thanks!
You can do it without all the Select/Activate stuff.
Dim rngFound As Range
Set rngFound = Range("Array1").Cells.Find("New Member")
If rngFound Is Nothing Then
Range("G5").Value = "Not Found"
Else
rngFound.Offset(,-5).Resize(,5).Copy Range("G5")
End If
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.