You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Witam! Siedzę nad problemem już 2 dni i nic nie mogę wymyślić. Wiem że sprawa jest prosta, ale nie mogę sobie poradzić z tą funkcją w VBA. Napisałem funkcję w Excelu , ale ponieważ ona na bieżąco analizuje cały arkusz więc przez to spowalnia działanie innych makr co powoduje że moje rozwiązanie jest nie do przyjęcia. Problem jest następujący: Załóżmy że mamy dane jedynie w dwóch kolumnach. Rekordów jest jakaś liczba n. Chcę napisać funkcję która obliczy mi ilość rekordów, kiedy w kolumnie pierwszej jest 1 ORAZ w kolumnie 2 jest np. 1,32, 51 , 6,7 .... (czyli jakieś wartości definiowane przeze mnie) Z góry dziękuję za pomoc i wszystkie sugestie Pozdrawiam Piotrek
Jacek
unread,
Dec 15, 2008, 10:56:04 AM12/15/08
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Zakladajac, ze wartosci zdefiniowane przez Ciebie sa w kolumnie C, a dane sa w A i B, to cos w tym stylu:
Sub qq() x = 1 While Cells(x, 1) <> "" y = 1 Do While Cells(y, 3) <> "" If Cells(x, 1) = 1 And Cells(x, 2) = Cells(y, 3) Then N = N + 1 Exit Do End If y = y + 1 Loop x = x + 1 Wend Cells(1, 4) = N End Sub
rados...@gmail.com
unread,
Jun 26, 2019, 8:57:35 AM6/26/19
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
a czy tak nie prościej:
lastR = Cells(Rows.Count, 1).End(xlUp).Row
'możesz dodatkowo wynik wpisać sobie w jakąś komórkę:
Range("D1") = lastR
i odrazu wiesz ile masz wierszy, a to identyfikuje ci liczbę rekordów...