Copy cell down .... when another is filled

lacogada

Board Regular
Joined
Jan 26, 2011
Messages
170
check.jpg


I have a form that fills col A to E.

Have "if" formula in F.

What is the best way to have the "if" formula copied
down everytime a new entry is added ?

I would like it dynamic ... as not to just copy the "if" formula
down so many rows ... not knowing how far to go.

Is there VBA code for doing this ?
 
Thanks for the replys ... the new code works, sort of.

As long as data is already on the sheet (below row 2) it works fine.

But if I remove all data ... like starting with a brand new balance,
it actually will not let me input the balance to start with.

If I type in a new balance it changes the cell to as nothing,
but the "if" formula from the code is in that cell.

Seems the code would need to look only below row 2.

Again thanks ... it's close

@Roj47 .... thats why I was looking for VBA code as I did not want to
just copy cells down ... wanted dynamic, to change with data

The was code amended too test the Row 3 (and below) values of A and D, based on the formula you provided. In your formula does changing the F2's to $F$2 help? Not sure I understand your question or whether I have a solution?
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
The formula/code works fine as long as data is in row 3 to begin with.

When I remove all data and try to input a new balance in cell F2,
it is changed to a blank cell or shows on screen as blank.

But that "if" formula in the code is actually transfered to the cell
but it shows on screen as being blank.

I guess this is because of the "Selection Change event"

Appreciate your effort .... may be someone else may have another idea.

..... and the $F$2 dos not do anything different.
 
Upvote 0
Ah, I think I see what you mean. When I've tried it for some reason it puts the formula in F2... even though it's not meant to? Is that right?

When you select F2 do you see the formula lacogada?
 
Upvote 0
@SuperFerret .... yes that's what was happening.

Had to change

HTML:
lr = Cells(Rows.Count, 1).End(3).Row

to

HTML:
lr = Cells(Rows.Count, 1).End(2).Row

Can now delete all data an input new starting balance.

Thanks
 
Upvote 0
Maybe this could be modified? I would attach to a button in a test sheet as I would not really trust anything I stick on here as it is a mixture of help, guesses and Google research :)

Sub Copy_Formula()
'
' Copy_Formula Macro
' '
'
Dim LR As Long
LR = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row - 1
Range("F3").Copy
Range("F3:F" & LR).PasteSpecial Paste:=xlFormulas
Application.CutCopyMode = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top