Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, I am a new Macro user and am trying to come up with one that
locates a "specific word" then will copy a cell located 2 cells down from the specific word and paste it at another specified location. Can anyone help? Thanks, Jimmy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like this
Sub FindAndCopy() Dim wksFind As Worksheet Dim wksPaste As Worksheet Dim rngFind As Range Dim rngToSearch As Range Dim rngPaste As Range Set wksFind = Sheets("Sheet1") Set rngToSearch = wksFind.Cells Set rngFind = rngToSearch.Find("That") If rngFind Is Nothing Then MsgBox "Not Found" Else Set wksPaste = Sheets("Sheet2") Set rngPaste = wksPaste.Range("A1") rngFind.Offset(2, 0).Copy rngPaste End If End Sub -- HTH... Jim Thomlinson "Jimmy Pop" wrote: Hello, I am a new Macro user and am trying to come up with one that locates a "specific word" then will copy a cell located 2 cells down from the specific word and paste it at another specified location. Can anyone help? Thanks, Jimmy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Locating amesaage | Excel Discussion (Misc queries) | |||
Locating | New Users to Excel | |||
locating the top 5 number (in a col) | Excel Worksheet Functions | |||
Locating a value anywhere in a row and copying that row to new she | Excel Programming | |||
Dynamically locating value; selecting that row and everything above (or below) and deleting/copying | Excel Programming |