Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi There
I import my data to A1, Sheet1. Then run a macro to sort it and move it to other sheets. What I would like to do, is do a test before the macro runs. To Test if Column A contains the word "Found" in any sentence. if yes Stop macro, If No continue with the macro. Thanks in Advance Dave |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range
set rng = Columns(1).Find( "Found", Lookin:=xlFormulas, _ LookAt:=xlPart) if not rng is nothing then Exit sub ' rest of your macro -- Regards, Tom Ogilvy "Dave 2005" wrote in message ... Hi There I import my data to A1, Sheet1. Then run a macro to sort it and move it to other sheets. What I would like to do, is do a test before the macro runs. To Test if Column A contains the word "Found" in any sentence. if yes Stop macro, If No continue with the macro. Thanks in Advance Dave |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Dave
if Application.CountIf(Sheets("Sheet1").Columns("A:A" ), "*found*") then Msgbox "End here" Exit Sub End if 'Your code here -- XL2003 Regards William "Dave 2005" wrote in message ... Hi There I import my data to A1, Sheet1. Then run a macro to sort it and move it to other sheets. What I would like to do, is do a test before the macro runs. To Test if Column A contains the word "Found" in any sentence. if yes Stop macro, If No continue with the macro. Thanks in Advance Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |