View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default macro to copy following cells in the same column

I have the following formula in the active cell
ActiveCell.FormulaR1C1 = _

"=LOOKUP(6.022*10^23,--MID(RC[1],MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},RC[1]&""0123456789"")),ROW(INDIRECT(""1:""&LEN(RC[1])))))"

Please help me to copy the above forumula to the following cells in the same
column by using the following macros . But I have to refer the active cell
formula instead of refering a particular cell like (("B3:B") I have to say
from the active cell to the cell of last row

I need to avoid (("B3:B") and .Range("B3"). Instead I have to use active
cell




Dim Wks As Worksheet
Dim LastRow As Long

Set Wks = ActiveSheet

With ActiveSheet
LastRow = .Cells(.Rows.Count, "C").End(xlUp).Row
.Range("B3:B" & LastRow).FormulaR1C1 = .Range("B3").FormulaR1C1
End With