KEMBAR78
Find Column Header and Update Value in Next Row Cell | PDF
0% found this document useful (0 votes)
11 views1 page

Find Column Header and Update Value in Next Row Cell

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

Find Column Header and Update Value in Next Row Cell

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Function PPUpdate()

Dim wb1 As Workbook


Dim wb2 As Workbook
Dim sht As Worksheet
Dim rng As Range
Dim PPStatus As Range
Dim ReleaseDate As Range
Dim vCriteria As String
Dim Reason As String
Dim RDate As String
Dim FindHeader As String

Set wb1 = ThisWorkbook


Set wb2 = Workbooks.Open("C:\Users\Vijayaraghavan\Documents\EVO Passport
Report updated 21 Dec 21.xls")
vCriteria = wb1.Worksheets("Sheet1").Range("A1").Value
Reason = wb1.Worksheets("Sheet1").Range("A2").Value
RDate = wb1.Worksheets("Sheet1").Range("A3").Value
Set sht = wb2.Worksheets("Worker")
Set rng = sht.Cells.Find("Emp No")
Set PPStatus = sht.Cells.Find("Passport Status")
Set ReleaseDate = sht.Cells.Find("Release date")
If Not rng Is Nothing Then
sht.ListObjects("PPTrack").Range.AutoFilter field:=rng.Column,
Criteria1:=vCriteria
FindHeader = Sheets("Worker").Cells.Find(What:="Passport
Status").Select
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = Reason
Range("A1").Select
FindHeader = Sheets("Worker").Cells.Find(What:="Release Date").Select
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = RDate
Set sht = Nothing
Set rng = Nothing
wb2.Worksheets("Worker").ListObjects("PPTrack").Range.AutoFilter
field:=2
End If
End Function

You might also like