B
Brian
Hello,
I have a situation where I am referencing data on another workbook. The
reason behind this is the data in Column H can be entered incorrectly and
often is. I am able to prevent this going forward but can not do so for the
items already entered. I enter a formula via VBA, however, sometimes the
result will be #N/A and if so I would prefer to leave the old value and just
highlight it that it needs to be verified by hand.
I am not sure if I can just "leave" the value as it has pretty much already
been replaced. Due to this, I copy the column to a different column and what
I hope to do is copy back the same row from column Z back to H if #N/A... I
have tried to write this 50 different ways but for some reason I am having
major problems. This is how I enter the formula and copy the pre formula
value to Z... Any help will be greatly appreciated!
With Workbooks("P-Score and Q-Score trends.xlsx").Worksheets("FO Ref List")
Columns("H").Copy
Range("Z1").PasteSpecial
With .Range("G5", .Range("G5").End(xlDown)).Offset(, 1)
.FormulaR1C1 = "=INDEX('[March 2010 ADIM 1047 report
(4).xls]ADIMR1047'!C21,MATCH(RC7,'[March 2010 ADIM 1047 report
(4).xls]ADIMR1047'!C26,0))%26"", ""%26INDEX('[March 2010 ADIM 1047 report
(4).xls]ADIMR1047'!C20,MATCH(RC7,'[March 2010 ADIM 1047 report
(4).xls]ADIMR1047'!C26,0))"
.Value = .Value
End With
End With
Thank you!
I have a situation where I am referencing data on another workbook. The
reason behind this is the data in Column H can be entered incorrectly and
often is. I am able to prevent this going forward but can not do so for the
items already entered. I enter a formula via VBA, however, sometimes the
result will be #N/A and if so I would prefer to leave the old value and just
highlight it that it needs to be verified by hand.
I am not sure if I can just "leave" the value as it has pretty much already
been replaced. Due to this, I copy the column to a different column and what
I hope to do is copy back the same row from column Z back to H if #N/A... I
have tried to write this 50 different ways but for some reason I am having
major problems. This is how I enter the formula and copy the pre formula
value to Z... Any help will be greatly appreciated!
With Workbooks("P-Score and Q-Score trends.xlsx").Worksheets("FO Ref List")
Columns("H").Copy
Range("Z1").PasteSpecial
With .Range("G5", .Range("G5").End(xlDown)).Offset(, 1)
.FormulaR1C1 = "=INDEX('[March 2010 ADIM 1047 report
(4).xls]ADIMR1047'!C21,MATCH(RC7,'[March 2010 ADIM 1047 report
(4).xls]ADIMR1047'!C26,0))%26"", ""%26INDEX('[March 2010 ADIM 1047 report
(4).xls]ADIMR1047'!C20,MATCH(RC7,'[March 2010 ADIM 1047 report
(4).xls]ADIMR1047'!C26,0))"
.Value = .Value
End With
End With
Thank you!