Min not zero revisited

M

Matt S

I am trying to input an array function onto my Excel sheet through VBA. I
try the following code, and instead of giving me some type of error... it
just skips past the rest of my code and goes straight to "End Sub" after
trying to evaluate.

Can someone please tell me two things... 1) what did I do wrong? and 2) why
would it skip all the rest of my code and go straight to End Sub?

Thanks!
Matt

LastRow = Cells(Rows.Count, "F").End(xlUp).Row
ActiveCell.Offset(3, 0).FormulaArray = "=MIN(IF(R13C:R" & LastRow &
"C)>0,R13C:R" & LastRow & "C))"
 
M

Matt S

All,
I found the problem... I was missing a "(". Not sure why this would stop
the macro though. I also ran into another problem immediately after fixing
that one... I tried this code:

ActiveCell.Range("A1:A3").Copy
Destination:=ActiveCell.Range("A1:J3,L1:O3,Q1:S3")

Thinking it would copy the Formula Array but this promptly stopped the macro
as well. So then I tried this:

ActiveCell.Offset(3, 0).Range("A1:J1,L1:O1,Q1:S1").FormulaArray =
"=MIN(IF((R13C:R" & LastRow & "C)>0,R13C:R" & LastRow & "C))"

It copies the formula over... but it retains the same column as the first
cell for all the range. Please help! How do I copy this formula array in
multiple cells?

Thanks so much,
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top