Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default locating and copying

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default locating and copying

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Locating amesaage Marc W Excel Discussion (Misc queries) 2 September 25th 09 01:58 PM
Locating Karmen New Users to Excel 2 January 30th 06 11:45 PM
locating the top 5 number (in a col) owl527 Excel Worksheet Functions 1 January 10th 06 01:35 PM
Locating a value anywhere in a row and copying that row to new she SueJB Excel Programming 6 December 6th 04 06:59 PM
Dynamically locating value; selecting that row and everything above (or below) and deleting/copying Steven Rosenberg[_2_] Excel Programming 14 February 29th 04 11:10 PM


All times are GMT +1. The time now is 05:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"