VBA Jira Auswertung.xlsm | ||||
---|---|---|---|---|
A | B | |||
1 | Name | Storypoints | ||
2 | Sprint 08 | 10 | ||
3 | Sprint 08 | 20 | ||
4 | ||||
5 | ||||
Tabelle1 |
VBA Jira Auswertung.xlsm | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | Name | Storypoints | Kosten | ||||||||
2 | Sprint 05 | 0 | |||||||||
3 | Sprint 06 | 0 | |||||||||
4 | Sprint 07 | 0 | |||||||||
5 | Sprint 08 | 0 | |||||||||
6 | |||||||||||
7 | |||||||||||
8 | |||||||||||
Auswertung |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2:C5 | C2 | =B2*81 |
Hello guys,
i have a question regarding VBA. I want to, based on my finding from my macro, copy the sum of the storypoints of the sprint from sheet "Tabelle1" to sheet "Auswertung". Thus in my example, if something is found for Sprint 08, and the sum is calculated, this sum for Sprint 08 should be copied to sheet "Auswertung" (Thus sum=30 should be copied) to the cell in column B where cell in A has name "Sprint 08". THerefore in cell B5 the sum should be entered, because A5 has "Sprint 08".
However I didn't figure it out yet how to write that in VBA. Could you please help me out here?
Thank you!
Below you can also find my current VBA code:
Private Sub CommandButton2_Click()
'Read Value from Textbox
TxTbx = TextBox1.Text
'Value from Textbox is stored in cell
Worksheets("Auswertung").Range("Z4").Value = Me.TextBox1
Tabelle1.Select
'Check if Textbox Value is found on other sheet
'Declare Variables
Dim sumRange As Range
Dim Fund As Range
Dim criteriaRange As Range
Dim criteria As String
Set sumRange = Range("B2:B11")
Set criteriaRange = Range("A2:A11")
criteria = Worksheets("Auswertung").Range("Z4").Value
Sheets("Tabelle1").Select
Set Fund = Range("A:A").Find(Worksheets("Auswertung").Range("Z4"))
If Not Fund Is Nothing Then
'Save SumIfs Value in Cell
Range("J4") = WorksheetFunction.SumIfs(sumRange, criteriaRange, criteria)
Range("J4").Copy
Else
MsgBox Prompt:="Ihr Suchbegriff " & Sheets("Auswertung").Range("Z4") & " existiert nicht im Sheet Tabelle1. Bitte prüfen Sie Ihre Eingabe!"
Sheets("Tabelle1").Range("J4").ClearContents
End If
'Range("J4").ClearContents
'Worksheets("Auswertung").Range("Z4").ClearContents
'Closing of UserForm
Unload Sprinteingabe
End Sub