schappelljr
Board Regular
- Joined
- Feb 2, 2009
- Messages
- 55
This Macro is searching for the word “Print” Checking a value of a cell and calling other macros. I have it working but I want to change the word that I am searching “Print” to “printed” .The problem that I am having is ending the loop. I don’t know how many times the loop will have to run.
Sub SheetMaker()
'
' Sheet Maker
'
'
Dim foundCell As Range
Dim firstFoundAddress As String
With Range("A:A"): Rem adjust
Set foundCell = .Find("print", after:=.Cells(.Rows.Count, 1), searchdirection:=xlNext)
If foundCell Is Nothing Then
MsgBox "not found"
Exit Sub
End If
firstFoundAddress = foundCell.Address
Do
foundCell.Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "Printed"
ActiveCell.Offset(0, 2).Select
If ActiveCell.Value = "Night" Then
Call Nightsheet
End If
If ActiveCell.Value = "Day" Then
Call DaySheet
End If
Set foundCell = .FindNext(after:=foundCell)
Loop Until foundCell.Address = firstFoundAddress
End With
End Sub