Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
VB Code Problem
I have the following code and it works fine unless it can't find a row
containing the text "Open Time". I recieve the error message "Object variable or With block variable not set. I would like to code to ignore this section if it can't find the text "Open Time" and move onto the next section of code. Can someone tell me how I can do this? Many thanks! Sub FindMacro1() Dim rng As Range Cells(1, 1).Select Set rng = Range("A1:IV65400").Find(what:="Open Time", _ After:=ActiveCell, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False) Range(rng, rng.End(xlToRight)).Cut ActiveCell.End(xlDown).Offset(1, 0).Select ActiveSheet.Paste ActiveCell.Select ActiveCell.End(xlUp).Offset(-1, 0).Select Selection.EntireRow.Delete |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
XLS to CSV Code Problem | Excel Worksheet Functions | |||
Strange problem with Code | Excel Worksheet Functions | |||
Little problem with this code... | Excel Discussion (Misc queries) | |||
Can anyone figure this code problem please | Excel Discussion (Misc queries) | |||
Problem with criteria when using it from VBA Code | Excel Worksheet Functions |