Forum Discussion
killerBee615
Jul 27, 2020Copper Contributor
Hey!
i need help for creating a code, Count several variables in the same column. like 1R, 1B, 1G and so on thank you!
- Jul 29, 2020
If combine mtarler formulas in one
=FILTER(IF({1,0},SORT(UNIQUE(LEFT($A$2:$A$1500,LEN($A$2:$A$1500)-1))), COUNTIFS($A$2:$A$1500,SORT(UNIQUE(LEFT($A$2:$A$1500,LEN($A$2:$A$1500)-1)))&"?")), COUNTIFS($A$2:$A$1500,SORT(UNIQUE(LEFT($A$2:$A$1500,LEN($A$2:$A$1500)-1)))&"?") >0)
NikolinoDE
Jul 27, 2020Platinum Contributor
On the fast, a code to try.
Just have to adjust to your needs 🙂
Sub Summ()
Dim sh As Worksheet
Dim rngFind As Range
Dim strSuchen As String
Dim sngSum As Single
strSuchen = InputBox("Nummer?")
If strSuchen = "" Then Exit Sub
For Each sh In Worksheets
Set rngFind = sh.Cells.Find(strSuchen, Cells(1, 1))
If Not rngFind Is Nothing Then
If IsNumeric(rngFind.Offset(0, 1).Value) Then
sngSum = sngSum + rngFind.Offset(0, 1).Value
End If
Set rngFind = Nothing
End If
Next sh
MsgBox sngSum
End Sub
Nikolino
I know I don't know anything (Socrates)
Just have to adjust to your needs 🙂
Sub Summ()
Dim sh As Worksheet
Dim rngFind As Range
Dim strSuchen As String
Dim sngSum As Single
strSuchen = InputBox("Nummer?")
If strSuchen = "" Then Exit Sub
For Each sh In Worksheets
Set rngFind = sh.Cells.Find(strSuchen, Cells(1, 1))
If Not rngFind Is Nothing Then
If IsNumeric(rngFind.Offset(0, 1).Value) Then
sngSum = sngSum + rngFind.Offset(0, 1).Value
End If
Set rngFind = Nothing
End If
Next sh
MsgBox sngSum
End Sub
Nikolino
I know I don't know anything (Socrates)
killerBee615
Jul 28, 2020Copper Contributor
- NikolinoDEJul 29, 2020Platinum Contributor
Maybe something very simple ... even if the formulas from the others are much better than these
Nikolino
I know I don't know anything (Socrates)
- NikolinoDEJul 28, 2020Platinum ContributorNo problem, is in German VBA, should actually be converted to English. Whichever solution has helped you please tick as correct answer so that others can get this info.
Nikolino
I know I don't know anything (Socrates)