fill formula based on fill column until specific row

Mussa

Board Regular
Joined
Jul 12, 2021
Messages
241
Office Version
  1. 2019
  2. 2010
Hi Guys
I need fill this formula in column H from H8=F8*G8 until row contains text in column C ="PAID" based on entering in column B .
should stop fill formula until row contains PAID in column C . after fill the formula should show as in value
thanks
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi @Mussa

Try this:

VBA Code:
Sub fillforumula()
  Dim f As Range
  
  Set f = Range("C:C").Find("PAID", , xlValues, xlWhole, xlByRows, xlNext, False)
  If Not f Is Nothing Then
    With Range("H2:H" & f.Row)
      .Formula = "=F2*G2"
      .Value = .Value
    End With
  End If
End Sub
 
Upvote 1
Solution
Hi
thanks, but it shows the formula in last row "PAID" in column H , shouldn't show .
 
Upvote 0
should stop fill formula until row contains PAID in column C
thanks, but it shows the formula in last row "PAID" in column H , shouldn't show .
I didn't understand that part, but the change is minimal.
Change this:
VBA Code:
With Range("H2:H" & f.Row)

For this:
VBA Code:
With Range("H2:H" & f.Row -1)
 
Upvote 0
umm, you seem to understood me the formula should add until to lastrow contains PAID .
sorry for my bad explanation !!🙏🙏
thank you very much for your help & support :)
 
Upvote 0

Forum statistics

Threads
1,215,453
Messages
6,124,930
Members
449,195
Latest member
Stevenciu

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