I need a help in completing a automated script for one of the application I am not able to complete the vba script which need to compare from sheet1 to sheet2 and update the sheet3 and auto save it
I am trying to get the column output in variable and later update sheet3 but not able to get the output
for example sheet 1 has more than 200 servers
For example
DHHENSDVE31\TEST_BE |
in sheet 2 i have column C , D and E , C has the server name and D has the variable i am trying to match to get the column E output
C D E
DHHENSDVE31\TEST_BE |
Errorlog |
Compliant |
I have also attached the sheet
Sub Healthcheck()
' Select cell A2, *first line of data*.
Dim servername As String 'Instance name
Dim xStr As String 'trial and error
Dim Machinename As String 'Server name
Dim Ipaddress As String
Dim Healthcheck As String ' HC Value
Dim Status As String ' HC Status
Dim Username As String ' Issue User
'Sheets("Sheet1").Activate
Worksheets("ServerList").Activate
Range("A2").Select
' Set Do loop to stop when an empty cell is reached.
Do Until IsEmpty(ActiveCell)
' Insert your code here.
' Step down 1 row from present location.
xStr = ActiveCell.value
'MsgBox "Server is : " & xStr 'check for output
MsgBox "Server is : " & xStr
Healthcheck = "Errorlog"
Status = Index(Sheets("CSVReport").Range("E2:E10000"), Match(1, WorksheetFunction.CountIfs(Sheets("CSVReport").Range("C2:C10000"), xStr, Sheets("CSVReport").Range("D2:D10000"), Healthcheck), 0))
MsgBox "Server count is : " & Status
'If Not IsError(Application.Match(1, WorksheetFunction.CountIfs(Sheets("CSVReport").Range("C2:C10000"), xStr, Sheets("CSVReport").Range("D2:D10000"), Healthcheck), 0)) Then
'Status = Application.Match(1, WorksheetFunction.CountIfs(Sheets("CSVReport").Range("C2:C10000"), xStr, Sheets("CSVReport").Range("D2:D10000"), Healthcheck), 0)
'MsgBox "Server is : " & Status
'Else
MsgBox " no match is found in range"
'End If
ActiveCell.Offset(1, 0).Select
Loop
End Sub