Hi,
I have one small problem to be rectified. I have a master file where all the Pending task is identified. Now according to the code, it identifies the word "Pending" and executes the code. I have changed the word "Pending" to "P", I am unable to execute the code, here is the code
Sub Ron99()
Dim strPassword As String
strPassword = "Enter"
If InputBox("Please Enter Password to continue") <> strPassword Then
MsgBox "Incorrect Password please contact the Administrator to gain entry"
Exit Sub
Else
ActiveSheet.Protect DrawingObjects:=False, Contents:=False, Scenarios:=False
Dim LR As Long, _
LC As Long, _
dWs As Worksheet, _
sWs As Worksheet, _
rowx As Long, _
Rng As Range, _
rng1 As String
Sheets("GCS Activities").Select
Set sWs = ActiveSheet
Sheets.Add After:=sWs
Set dWs = ActiveSheet
dWs.Name = "Pending Task"
rowx = 2
Application.ScreenUpdating = False
LR = sWs.Range("A" & Rows.Count).End(xlUp).Row
LC = sWs.Cells(1, Columns.Count).End(xlToLeft).Column
dWs.Cells(1, 1).Value = "Name"
dWs.Cells(1, 2).Value = "Activity"
dWs.Cells(1, 3).Value = "Due Date"
With sWs.Range(sWs.Cells(5, 5), sWs.Cells(LR, LC))
Set Rng = .Find("Pending", LookIn:=xlValues)
If Not Rng Is Nothing Then
rng1 = Rng.Address
Do
dWs.Cells(rowx, 1).Value = sWs.Cells(4, Rng.Column).Value
dWs.Cells(rowx, 2).Value = sWs.Cells(Rng.Row, 2).Value
dWs.Cells(rowx, 3).Value = sWs.Cells(Rng.Row, 4).Value
rowx = rowx + 1
Set Rng = .FindNext(Rng)
Loop While Not Rng Is Nothing And Rng.Address <> rng1
End If
End With
dWs.Range("A:C").Sort Key1:=dWs.Range("A2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Application.ScreenUpdating = True
Application.StatusBar = False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1").Select
End If
MsgBox ("Please proceed with data sorting !!")
End Sub
The above word Pending which I have marked in red, I changed it to "P", it doesnt work, I think there should be somewhere else I need to correct, I need your help.