Add a new blank cell too ONE specific column

julhs

Active Member
Joined
Dec 3, 2018
Messages
407
Office Version
  1. 2010
Platform
  1. Windows
The code below does what it is supposed to do; it finds “Cash Paid” in Col T and then adds a new row to columns N:AJ
and populates them with formula from the cells above.
VBA Code:
'This will Insert a new Blank Row and places formulas into the new row.
' Then Finds the last used row(looking up from bottom) and inserts Data into next Blank row.

Private Sub cmdAddEntry_Click()
Dim LastRow As Long
Dim LR1 As Long
Dim wt As Worksheet

Set wt = ThisWorkbook.ActiveSheet
               Application.ScreenUpdating = False
        With wt
                    LastRow = .Columns("T:T").Find("Cash Paid", , xlFormulas, xlWhole, xlByRows, xlNext, False).Row
LR1 = .Range(.Cells(9, "N"), .Cells(LastRow - 1, "AJ")).Find("*", , xlValues, , xlByRows, xlPrevious).Row

If LR1 = LastRow = 0 Then '(this needs to be 0 otherwise this doesn't work)
.Range("N" & LR1 + 1 & ":AJ" & LR1 + 1).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
.Range("N" & LR1 + 1 & ":AJ" & LR1 + 1).FillUp
LastRow = LR1 + 1
End If
But I want to do the same sort of thing in Col Z , with starting cell Z$237 named “Flowers”

BUT ONLY WHEN a value is added in cell Z$238
This is the formula that populates the cell Z$238
VBA Code:
{= IF(SUMPRODUCT(--($R$7:$R103=Z$237))>=ROWS(Z$240:Z240),INDEX($S$7:$S103,SMALL(IF($R$7:$R103=Z$237,ROW($R$7:$R103)-ROW($S$7)+1),ROWS(Z$240:Z240))),"")}

In a nut shell; I want Col Z to add and format a new blank cell, ONLY WHEN and IF a new value has been added into eg Z$238

I sincerely hope this makes sense ????
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Going to bump this as I have not made any progress with it myself!

Rephrasing the question ……

The “Private Sub cmdAddEntry_Click()” code in post #1 does what it is supposed to do; it finds “Cash Paid” in Col T and then adds a new row to columns N:AJ and populates them with formula from the cells above.
How can I do the same; insert a new formatted cell IF the (Cell Z$245) “Sum” value changes

Cell Z$237 = “Flowers” ; is xx number of rows BELOW the “Cash Paid” cell in column T.
Cells Z$238 : Z$244 ; contain the below Array formula (adjusted accordingly) that populates them.
Cell Z$245 =SUM(Z238:Z244)
VBA Code:
{= IF(SUMPRODUCT(--($R$7:$R103=Z$237))>=ROWS(Z$240:Z240),INDEX($S$7:$S103,SMALL(IF($R$7:$R103=Z$237,ROW($R$7:$R103)-ROW($S$7)+1),ROWS(Z$240:Z240))),"")}
 
Upvote 0

Forum statistics

Threads
1,214,780
Messages
6,121,525
Members
449,037
Latest member
tmmotairi

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