ahmed1987 قام بنشر فبراير 2 قام بنشر فبراير 2 السلام عليكم ورحمة الله وبركاته تحية طيبة اساتذة ارجو المساعده لو فرضنه عندي اي جملة او كلمات على سبيل المثال ( اوفيسنا) موجود في خلية A1 اريد عدد حرف ( أ ) يطلعلي نتيجة 2 وهكذا كل ما اغير الحرف يحصالي شكرا لكم جميعا
lionheart قام بنشر فبراير 3 قام بنشر فبراير 3 Put your string in cell A1 then run the following code that will list all the characters and their count in column C and D Sub Count_All_Characters() Dim ch, arrKeys, arrValues, ws As Worksheet, dict As Object, txt As String, i As Long Set ws = ActiveSheet Set dict = CreateObject("Scripting.Dictionary") txt = ws.Range("A1").Value For i = 1 To Len(txt) ch = Mid(txt, i, 1) dict(ch) = dict(ch) + 1 Next i With ws .Columns("C:D").ClearContents .Range("C1:D1").Value = Array("Character", "Count") If dict.Count > 0 Then arrKeys = dict.Keys arrValues = dict.Items .Range("C2").Resize(dict.Count, 1).Value = Application.Transpose(arrKeys) .Range("D2").Resize(dict.Count, 1).Value = Application.Transpose(arrValues) End If End With Set dict = Nothing MsgBox "Done", 64 End Sub 1 2
عبدالله بشير عبدالله قام بنشر فبراير 3 قام بنشر فبراير 3 وعليكم السلام ورحمة الله وبركاته اظافة الى ما تفضل به استاذنا lionheart اضيف حل بالمعادلات اكنب الحرف المراد احصائه في الخلية D1 =LEN(A1)-LEN(SUBSTITUTE(A1;$D$1;"")) مثال عد الاحرف.xlsx 1 2
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.