Here is the code
Sub ViewShortage()
Dim shtS As Worksheet ' Shortage Report Worksheet
Dim shtP As Worksheet ' Pivot Table Worksheet
Dim shtC As Worksheet ' Current Workbench
Dim PartNum As String ' Part Number
' intialize variables
Set shtS = Sheets("Shortage Report")
Set shtP = Sheets("Shortage Pivot")
Set shtC = Sheets("Current Workbench")
Application.ScreenUpdating = False
Application.Calculation = xlManual
If Intersect(Selection, shtC.Range("Table_Current_Workbench")) Is Nothing Then
MsgBox "Please select a cell in the table", vbOKOnly, "Select Part Number"
Exit Sub
End If
PartNum = shtC.Cells(Selection.Row, "A")
Range("Sel_Part") = PartNum
If Range("Short_Count") = 0 Then
MsgBox "This part is not on the shortage report", vbOKOnly, "Part Not Found"
Exit Sub
End If
' Clear Table and copy the pivot information
ClearTable shtS, "Table_Shortage_Report"
Application.ScreenUpdating = True
Range("Short_Pivot_Copy").Copy
shtS.Range("A4").PasteSpecial xlPasteValues
range("Table_Shortage_Report").Replace("(blank)","")
shts.Range ("Table_Shortage_Report").Replace(what:="(balnk)", replacement:="", lookat:= xlwhole, Matchcase:=false))
Application.Calculation = xlAutomatic
End Sub
I get a syntax error on both of the attempted Replace commands. What is the correct syntax?
Bookmarks