Been trying to look up VBA code to search a specific column name "Process Total" in "column I" of tab name "AWD List" based on Column D name "POLRES"
Is there a way to find that "Process Total" row in Column I that corresponds to Column B name "POLRES" and then have it open that cell in "Column I" into a new sheet named "POLRES"
I've been working with VBA code that will open the "POLRES" "Process Total" cell reference and just enter the total number into the tab. I need it to open it up as if i'm double clicking and creating a pivot table (tab example in workbook)
Here is code I'm using:
[CODE]
Sub OpenPolresTotal() Dim Pfind As Object Dim Ptotal Dim TotalSheets As Integer Dim TestSheetNum As Integer Dim TestSheetName As String Dim NewSheet As String Dim SheetFound As Boolean With Sheets("AWD List").Columns("D") Set Pfind = .Find(What:="polres", LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False) End With If Not Pfind Is Nothing Then 'Where my VBA code errors out and is highlighted
Ptotal = Range("I" & Pfind.Row).showdetail=true Else MsgBox "not Found" End If 'check to see if sheet exists TotalSheets = Sheets.Count SheetFound = False For TestSheetNum = 1 To TotalSheets If Sheets(TestSheetNum).Name = "Polres" Then SheetFound = True Exit For End If Next If Not SheetFound Then Sheets.Add.Name = "Polres" Sheets("Polres").Cells(1, 1) = Ptotal End If End Sub
[CODE]