Thanks for looking, hope you can help!
I'm trying to select a cell that is the result of a .find function so that i can then select its entire row and copy it onto a new sheet.
My .find function is...
The CopyPaste Sub on a new module is...
So far I keep getting a "Select method of Range class failed" error message, which fromj what i can gather means the code can't decide what to select.
On changing the Select command to that shown below I get "Method 'Goto' of object '_Application' failed". I'm not sure if this is because the sheets in question are hidden or if there is another error.
</PRE>
Any help would be much appreciated.
Regards
Garry
I'm trying to select a cell that is the result of a .find function so that i can then select its entire row and copy it onto a new sheet.
My .find function is...
Code:
On Error Resume Next
[FONT=Courier New]With RecordsSheet[/FONT]
[FONT=Courier New]Set phoneChk = .Columns(1).Find(What:=phoneNumber, After:=.Cells(1, 1), LookIn:=xlValues, lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)[/FONT]
[FONT=Courier New]On Error GoTo 0[/FONT]
[FONT=Courier New]If Not phoneChk Is Nothing Then phoneChk.Select[/FONT]
[FONT=Courier New]Run "CopyPaste"[/FONT]
The CopyPaste Sub on a new module is...
Code:
[FONT=Courier New]Sub CopyPaste()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>Application.ScreenUpdating = FalseRecordsSheet.EntireRow.Copy SearchSheet.Range("A65536").End(xlUp).Offset(1, 0)Application.ScreenUpdating = True<o:p></o:p>End Sub[/FONT]
So far I keep getting a "Select method of Range class failed" error message, which fromj what i can gather means the code can't decide what to select.
On changing the Select command to that shown below I get "Method 'Goto' of object '_Application' failed". I'm not sure if this is because the sheets in question are hidden or if there is another error.
Code:
If Not phoneChk Is Nothing Then Application.Goto phoneChk, True
</PRE>
Any help would be much appreciated.
Regards
Garry