VBA: Dynamically change rows in a table based on a cell input [closed] - excel

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 days ago.
Improve this question
I have the following code which works fine for adding rows to my table:
enter image description here
However, I would like it to dynamically change as my input in cell B6 changes. Hence, delete the inserted rows and replace them with the new input in cell B6. (without deleting any of the data below in the table. Is this possible?
When using the following code i can add rows when changing the input in Cell B6, but it will not delete rows when cell B6 is changes, only add more rows. I have tried to figure out this code, but it deletes the data below in my table. Can anyone help me?

Related

I'm not getting the right output in excel [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 days ago.
Improve this question
I need help in pasting values of cell range to another worksheet's next empty cell/row.
Worksheet names - "data" and "test"
Copy values of B2:B15 from worksheet "data"
Paste values to next empty cell in column B of worksheet "test"
This is executed by clicking a button.
Thank you for your help.
I tried tweaking this one, but I really cannot get the output I want.
I found online.
code
This example uses an input.
I don't use text input box, all I need is just to copy what ever in the cell range into the another sheet's next empty cell in specific column.

Formula to return value based in text in multiple cells [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 days ago.
Improve this question
enter image description here
I have a spreadsheet where I want to display certain text dependent on the combination for column an and b.
Below is a picture of the columns and the outcome text I want to display. so for instance if I type "high" and "low stake"....then it will show "handle with care , keep satisfied" in column c
My IF formula didn't work.
enter image description here
Make a "helper" table and use FILTER formula as it would be much easier to change something than in nested IF formula.
Formula:
=IFERROR(FILTER($C$1:$C$4,($A$1:$A$4=A8)*($B$1:$B$4=B8)),"")
Result:

Excel without VBA: How to create a sequential number following pattern from a column [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have the following table:
I'd like to fill automatically the column with '001,002...' following the previous column. Please see the image to see the pattern (We'll have many in the future, it's crazy doing it manually)
I'm attching an example file: https://1drv.ms/x/s!Akmhm4db64ebrHQF9rlhwNUa7tdS?e=kUkFlV
Thank you!
Use TEXT and IF, like the following:
=TEXT(IF(A2<>A1,1,B1+1),"000")
Tested this formula in excel and it worked for me. Paste into cell B2 for your L4 code column and just copy down. As new items are added in column A, the pattern will repeat.
=IF(A2=A1,BASE(B1+1,10,3),BASE(1,10,3))
If you need to have it automatically populate to a predetermined row, drag the formula down (for example 1,000 rows) and use the following:
=IF(A2="","",IF(A2=A1,BASE(B1+1,10,3),BASE(1,10,3)))
Just for explanation purposes, what the formula is doing is looking at the previous item in column A and checking to see if it is the same as the current item, if yes, increment by 1, else start over at 1. The BASE function is adding the leading 0's.

How to extract specific ids [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
There is probably an easy way to do this. Just cant figure it out.
I have a huge dataset with multiple id:s that can have different code (column 2). How do I go about to extract by specific code "x" in this case and also extract all the ids that contains even one x. See image
From your screenshot it seems you are trying to filter IDs excluding code c. If I am correct then use below formula to E2 cell. If my assumption if wrong then please explain how your output is coming.
=IFERROR(INDEX($A$2:$B$12,AGGREGATE(15,6,(ROW($A$2:$A$12)-ROW($A$1))/($B$2:$B$12<>"c"),ROW(1:1)),COLUMN(A$1)),"")
Edit after clarification: Only for Office365 excel.
So, if you have Office365 excel then use below formula as per screenshot
E2=FILTER(A2:A12,ISNUMBER(MATCH(A2:A12,UNIQUE(FILTER(A2:A12,B2:B12="x")),0)))
F2=FILTER(B2:B12,ISNUMBER(MATCH(A2:A12,UNIQUE(FILTER(A2:A12,B2:B12="x")),0)))
If you do not have Office365 then you need to use combinations of few formulas by array entry which will slow your excel performance. Here is array formulas.
E2=IFERROR(INDEX($A$2:$A$12,AGGREGATE(15,6,(ROW($A$2:$A$12)-ROW($A$1))/(ISNUMBER(MATCH($A$2:$A$12,IF($B$2:$B$12="x",$A$2:$A$12,""),0))),ROW(1:1))),"")
F2=IFERROR(INDEX($B$2:$B$12,AGGREGATE(15,6,(ROW($A$2:$A$12)-ROW($A$1))/(ISNUMBER(MATCH($A$2:$A$12,IF($B$2:$B$12="x",$A$2:$A$12,""),0))),ROW(1:1))),"")
Press CTRL+SHIFT+ENTER to evaluate the formula as it is an array formula.

Skipping lines in Excel formula [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have been attempting to figure out a formula to skip blank lines when I am referencing a list of parts for a bill of materials. The problem I've been running into is where the parts list is being held is updated based on what is selected and then transferred to the actual bill of materials there are blank spaces because some machines have more or less parts. I need to skip these and go to the next line and continue with the cells from there. So if I go from Cell if A1:A24 are filled and A25:A29 are blank and A30 has data I want to skip until it gets to A30 and continue on from there (A30:A35).
Let's pretend your data looks something like what's in column A, and the results you want are in column C:
In cell C2 and copied down is this formula:
=IF(ROW(C1)>ROWS($A$2:$A$11)-COUNTBLANK($A$2:$A$11),"",INDEX($A$2:$A$11,SMALL(INDEX(($A$2:$A$11<>"")*ROW($A$2:$A$11)-ROW($A$2)+1,),COUNTBLANK($A$2:$A$11)+ROW(C1))))
Adjust the $A$2:$A$11 to suit your data. Make sure that in the -ROW($A$2)+1 portion, the $A$2 is the first cell of your data, even it is blank (the point being that data could be there, and that it's not a header, and it's the first cell the formula should look at).
Within the loop that you use to hop from cell to cell, put your code within this if statement:
If Not IsEmpty(yourCell) Then 'yourCell needs to be replaced
'your code goes here
End If

Resources