Hi,
I've got a macro that needs some tweaking. Because the raw data report doesn't have a fixed number of columns, I am having trouble with cell referencing. My code below doesn't work because the cell "BX9" may not always be the correct cell to reference. Can someone tell me how I can get the macro to reference the 1st cell under the header "CODE" instead?
ActiveCell.FormulaR1C1 = "CODE"
Range("BX9").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-3]=""OCF"",""FREIGHT"",IF(RC[-3]=""SFB"",""FREIGHT"",IF(RC[-3]=""SFC"",""FREIGHT"",IF(RC[-3]=""SWE"",""FREIGHT"",IF(RC[-3]=""BAF"",""BAF"","""")))))"
Thanks in advance.
Marco
I've got a macro that needs some tweaking. Because the raw data report doesn't have a fixed number of columns, I am having trouble with cell referencing. My code below doesn't work because the cell "BX9" may not always be the correct cell to reference. Can someone tell me how I can get the macro to reference the 1st cell under the header "CODE" instead?
ActiveCell.FormulaR1C1 = "CODE"
Range("BX9").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-3]=""OCF"",""FREIGHT"",IF(RC[-3]=""SFB"",""FREIGHT"",IF(RC[-3]=""SFC"",""FREIGHT"",IF(RC[-3]=""SWE"",""FREIGHT"",IF(RC[-3]=""BAF"",""BAF"","""")))))"
Thanks in advance.
Marco