Home » excel » Excel VBA formula Referencing between sheets

Excel VBA formula Referencing between sheets

Posted by: admin May 14, 2020 Leave a comment

Questions:

I am trying to add below code to my macro like to link the formula to an other sheet &INDEX(Sheet1!AA$3:Sheet1!AA$18; but somehow this is not working.

.Cells(intFirstEmptyCell, 1).FormulaLocal = "=""ORD-""&INDEX(Sheet1!AA$3:Sheet1!AA$18;MATCH(Q" & intFirstEmptyCell & ";Sheet1!AB$3:Sheet1!AB$18;0))&TEXT(COUNTIF(Q$3:Q" & intFirstEmptyCell & ";Q" & intFirstEmptyCell & ");""0000"")"
How to&Answers:

Change

Sheet1!AA$3:Sheet1!AA$18
Sheet1!AB$3:Sheet1!AB$18

… to,

Sheet1!AA$3:AA$18
Sheet1!AB$3:AB$18