what i have:
What i want:
=IF(ISNUMBER(MATCH(G2,'Hierarchy'!B:B,0)),"Exist","No")
What i'm getting:
=IF(ISNUMBER(MATCH(G2,Hierarchy!BB),0)),"Exist","No")
The single quotes around the sheet name are disappearing. i have tried:
I get the same result. I have also tried using a public constant to no avail.
The really weird part is when I go back into my workbook and try to change the formula manually, it deletes the single quote again!
I closed all my workbooks, and reopened everything and tried writing it manually, and it worked ok, but after i execute my macro, i can't type the single quote even manually anymore.
The rest of the macro just finds a cell, adds a column next to it, puts a title on the column, and sets some variables. i can't imagine anything else in the code affecting it but i've included it on the bottom.
I'm using Excel 2013. The code is in my PERSONAL.XLSB book, the file i'm working on is not saved as macro enabled.
Help?
Code:
ActiveCell.FormulaR1C1 = "=IF(ISNUMBER(MATCH(R[0]C[-1],'Hierarchy'!B:B,0))," & Chr(34) & "Exist" & Chr(34) & "," & Chr(34) & "No" & Chr(34) & ")"
What i want:
=IF(ISNUMBER(MATCH(G2,'Hierarchy'!B:B,0)),"Exist","No")
What i'm getting:
=IF(ISNUMBER(MATCH(G2,Hierarchy!BB),0)),"Exist","No")
The single quotes around the sheet name are disappearing. i have tried:
Code:
ActiveCell.FormulaR1C1 = "=IF(ISNUMBER(MATCH(R[0]C[-1]," & Chr(39) & "Hierarchy" & Chr(39) & "!B:B,0))," & Chr(34) & "Exist" & Chr(34) & "," & Chr(34) & "No" & Chr(34) & ")"
I get the same result. I have also tried using a public constant to no avail.
The really weird part is when I go back into my workbook and try to change the formula manually, it deletes the single quote again!
I closed all my workbooks, and reopened everything and tried writing it manually, and it worked ok, but after i execute my macro, i can't type the single quote even manually anymore.
The rest of the macro just finds a cell, adds a column next to it, puts a title on the column, and sets some variables. i can't imagine anything else in the code affecting it but i've included it on the bottom.
I'm using Excel 2013. The code is in my PERSONAL.XLSB book, the file i'm working on is not saved as macro enabled.
Help?
Code:
Sub HierarchyCheck()
Worksheets("Art Sci PERA Pre-Audit").Activate
Dim picfc As Range
Dim picfcr As Range
Dim hierchkr As Range
Set picfc = Range("A1:AZ1").Find("PICFC").Offset(1, 0)
Set picfcr = Range(picfc, picfc.End(xlDown))
Range("A1:AZ1").Find("PICFC").Select
ActiveCell.EntireColumn.Offset(0, 1).Insert
Set hierchkr = picfcr.Offset(0, 1)
ActiveCell.Offset(0, 1).Select
ActiveCell.Formula = "In FAS Hierarchy?"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=IF(ISNUMBER(MATCH(R[0]C[-1],'Hierarchy'!B:B,0))," & Chr(34) & "Exist" & Chr(34) & "," & Chr(34) & "No" & Chr(34) & ")"
Selection.AutoFill Destination:=hierchkr, Type:=xlFillDefault
End Sub
Last edited: