Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying a Cell
I'm trying to find a cell with a string of "SALES" and then copy it 2
columns over. Below is my FindCell function and CopyCell sub. I think FindCell is ok, but CopyCell sub isn't coping the cell. Any ideas? Sub CopyCell() Dim cell As Range Set cell = FindCell("SALES", Sheets(1).Cells) If cell Is Nothing Then 'action to take of no match Else cell.Offset(0, 2).Copy Worksheets("Sheet1").Range("AT4") 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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying cell contents from many cells and pasting into one cell | Excel Discussion (Misc queries) | |||
Copying format to a new cell, w/o overwriting destination cell contents | Excel Discussion (Misc queries) | |||
copying the function contained within a cell to anouther cell. | Excel Worksheet Functions | |||
Copying excel format from cell to cell | Excel Discussion (Misc queries) | |||
Copying data down to next dirty cell, then copying that data | Excel Programming |