Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Excel Button to add a cells value to another cell, based on two cell contents

$
0
0

I need a button/macro to add value of AG11, to a table on sheet2, however,

Cell AB10 has values 2025-2028 on a dropdown, then cell AH12 has 8 different possible values,

depending on the values of AB10 and AH12, depends where to add the value of AG11.

Any ideas? to help i can change the column headers of table in sheet 2 to 2025-2028 and the row headers to match possible values in Ah12.

i have the following so far... but how to add further condtions?

Private Sub CommandButton1_Click()

If Range("AH12") = "PrismaLarge" And Range("AB10") = "2028" Then    Worksheets("Sheet2").Range("H10") = Worksheets("Sheet2").Range("H10") + Worksheets("Dashboard").Range("AG11")End If

End Sub


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>