Good Evening,
First off, I'd like to thank everyone for answering VB related questions. With your help I was able to familiarize myself somewhat with VB.
Since this is my first post, I'd like to apologize if this question has already been asked. I searched on Google as well as this forum's own search engine, but failed to come up with a solution.
I'm in a situation that requires filtering. But since i was unable to successfully execute a macro that selects the first cell and pastes formula, I tried another method.
What I'm trying to do is basically create a condition when met copies a cell (with Formulas or just the formula) and replaces two other cells in the same row.
So far this is what I came up with:
Dim rng As Range
Sheets("DAILY").Select
Range("X10").Select
Range(Range("X10"), Range("X100000").End(xlDown)).Select
For Each rng In Selection
If ActiveCell.Text = "True" Then
ActiveCell.FormulaR1C1 = "=$P8/$L8"
ActiveCell.FormulaR1C1 = "=$M8*(1-VLOOKUP($C8,$Q$1:$R$6,2,0))"
ActiveCell.End(xlDown).Activate
End If
Next rng
But i keep getting errors trying to execute the macro.
Can anyone help me or provide me with advise as to what would be an efficient way?
Thanks,
Mojo
First off, I'd like to thank everyone for answering VB related questions. With your help I was able to familiarize myself somewhat with VB.
Since this is my first post, I'd like to apologize if this question has already been asked. I searched on Google as well as this forum's own search engine, but failed to come up with a solution.
I'm in a situation that requires filtering. But since i was unable to successfully execute a macro that selects the first cell and pastes formula, I tried another method.
What I'm trying to do is basically create a condition when met copies a cell (with Formulas or just the formula) and replaces two other cells in the same row.
So far this is what I came up with:
Dim rng As Range
Sheets("DAILY").Select
Range("X10").Select
Range(Range("X10"), Range("X100000").End(xlDown)).Select
For Each rng In Selection
If ActiveCell.Text = "True" Then
ActiveCell.FormulaR1C1 = "=$P8/$L8"
ActiveCell.FormulaR1C1 = "=$M8*(1-VLOOKUP($C8,$Q$1:$R$6,2,0))"
ActiveCell.End(xlDown).Activate
End If
Next rng
But i keep getting errors trying to execute the macro.
Can anyone help me or provide me with advise as to what would be an efficient way?
Thanks,
Mojo