Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This code looks like what I want to accomplish. I thought I could put
it in as a module and then run it from the macro toolbar, but I'm obviously wrong. Sorry I'm a noob. Where do I put this? Usage: MoveCell("myword") Sub MoveCell(ByVal sSearchString As String) Dim cell As Range Set cell = FindCell(sSearchString, Sheets(1).Cells) If cell Is Nothing Then 'action to take of no match Else cell(0, -1).Value = cell.Value End If End Sub Function FindCell(searchFor As String, _ searchRange As Range) As Range Application.DisplayAlerts = False With searchRange Set FindCell = .Find(what:=searchFor, After:=.Cells(.Cells.Count), _ LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=False) End With End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Wher is my Camera Button in Excel 2007? | Excel Discussion (Misc queries) | |||
Wher can I download a table of Physical Constants for Excel? | Excel Discussion (Misc queries) | |||
Create a function wher last digit is always set | Excel Worksheet Functions | |||
how do I create floating cells so I can view them no matter wher. | Excel Discussion (Misc queries) | |||
does anyone have a great Interest only amortization schedule wher. | Excel Discussion (Misc queries) |