excel-r1c1-notation

Excel Macro R1C1 formula not retaining values

无人久伴 提交于 2021-02-17 06:54:51
问题 I have an excel macro that creates a new excel sheet and fills it with a variable number of rows. I have a count of the number of rows stored in a variable. I'm using an R1C1 formula to multiply two cells together based on my row count. In the macro the formula looks like it's correct (if I add a break point and put a watch on it) but when the macro finishes the formula in the cell is incorrect. VB Code to generate formula: MainSheet.Cells(RowCount + 6, 6).FormulaR1C1 = "=R[" & RowCount + 3 &

Conditional formatting using the INDIRECT function fails with boolean AND or OR or with cells containing formulas

China☆狼群 提交于 2019-12-07 22:59:08
问题 I have the following function for checking whether column L contains the word "completed" and I use INDIRECT to be able to color the whole row with Conditional Formatting: =INDIRECT("l"&ROW())="completed" This function works. However, I need to extend this, I want to use Conditional Formatting based on an extra cell as well, so I tried this: =AND(INDIRECT("l"&ROW())="completed";INDIRECT("m"&ROW())="duplicate") When I use this second function inside the Excel worksheet they give the proper