0

i having a problem here and is it possible to call rowCount in the formula of RC ( row & column ) ?

    Dim rowCount As Long
    Sheets("VBAResult").Select
    Columns("A:A").Select
    rowCount = Selection.Count
    Columns("E:E").Select
    Selection.SpecialCells(xlCellTypeBlanks).Select
    Selection.FormulaR1C1 = _
        "=IF(ABC!R[rowCount]C[-3] <> """",ABC!R[rowCount]C[-3],"""")"
Alex Keoh
  • 3
  • 4

1 Answers1

2

Yes it's possible:

Selection.FormulaR1C1 = _
    "=IF(ABC!R[" & rowCount & "]C[-3] <>"""",ABC!R[" & rowCount & "]C[-3],"""")" 

Btw, consider about avoiding using select How to avoid using Select in Excel VBA macros

Community
  • 1
  • 1
Dmitry Pavliv
  • 35,333
  • 13
  • 79
  • 80