Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Thu, 04 Oct 2007 00:53:06 -0000, Chad
wrote: Patrick From your post it looks like you want to find a string and copy the string and the cell adjacent to this string, so two cells. This can be modified to suit. Good luck Chad Sub FindIt() Dim MyString As String MyString = InputBox("Find what?") 'Find the string in the inputbox Cells.Find(What:=MyString, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate 'Sets the cells copied to 2, pastes the data as well. ActiveCell.Resize(1, 2).Copy Sheets("sheet3").Range("A1") End Sub Ok, this works. Is it also possible to create a function for this one? So, in the macro, i call this function with 3 values; The searchstring, sheet and pastecell e.q. "String", "sheet3", C4 Reg. Patrick. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find-Copy and Paste | Excel Programming | |||
Find Copy Paste | Excel Programming | |||
Find/Copy/paste.. then Find/Paste - not working ... at all.... | Excel Programming | |||
Find Copy and Paste | Excel Programming |