If cell contain blank then result is, Simple Macro?

Hi I am trying to achieve what I believe to be a simple macro, I have made functions per cell but a macro to run across the entire sheet would be better.

I am trying to achieve as follow:

IF A1=“1” and A2=“2” Then Result is A3=“3” else do nothing OR IF A1=“2” and A2="3"Then Result is A3=“4”

I would have multiple of these per row and would want it repeated every row.

I appreciate any help anyone can give me here I’ve been trying for hours

Thank You

Why not a formula that can be copied? =IF(AND(A1=1,A2=2),3,IF(AND(A1=2,A2=3),4,""))

Yes I currently use that exact formula that does the job but I figured a macro may be more efficient as I have to do this multiple time a month for jobs.

You might like to learn from Andrew Pitonyak’s book and other resources linked from Macros - The Document Foundation Wiki

I don’t think it is more “efficient” to “run across the entire sheet” when only 3 cells are concerned.
.
If it is only you, needing to re-create similiar sheets: Have you considered creating a template with your formula?

I need it to run across thousands of rows that are 20 columns wide and give me an output at the end of the row in a specific cell. Is it still simpler to run as a function? The ending results may need to be modified roughly twice a year and there are multiple outcomes based on information in the row. I was hoping to make it so I can easily modify it. I appreciate any help on this.

As I have no clue, what your macro will actually do in “thousands of rows that are 20 columns wide”, I think you have to start with Pitonyak, as already recommended.

my guess is: there is something badly wrong in the previous workflow that should be changed, instead of fiddling around with the effects here!

how about help not criticism? thanks

Sorry, but sometimes real help starts with criticism.

so do you actually have an answer to assist with data that is always variable? or just a troll?

huh?! calm down! have a look on my profile!

It is your task to provide a sufficiently concrete description of the initial situation, preferably together with a calc file ( no screenshot ) with which one can work out a solution!

1 Like

again very simple if a specific column contains exact text in a specific row and and another specific column contains a specific text in that row then a specific result to populate in a blank cell at the end of the row? then this needs to continue every row. is this simple enough for you troll?

you have great credits but there is no way to give you a thumbs down so in a world where you can only promote people you fail

OK I’m out of here, not need to be insulted here!

Sorry, but sometimes insults starts with truth.

It could seem more efficient, but it would definitely not.
LibreOffice uses many optimizations for the normal columnar formulas, including multi-threaded calculations, when the column cells have exactly the same formulas, and the inter-dependencies are well-defined. There is no way a macro could out-perform that.

You have been given both good advises to re-consider your preferred approach (which you failed to appreciate), and a link to the macro learning materials.

Thank you so much that’s all I was looking for