اذهب الي المحتوي
أوفيسنا

المبيعات الشهرية


الردود الموصى بها

Try This file

CODE

Sub Give_Date()
Dim Start_Date As Date
  Start_Date = DateSerial([b5], [b4], 1)
Dim My_date As Date
  My_date = Start_Date
Dim Dict As Object, x%
 On Error GoTo Wrong_data
  Set Dict = CreateObject("Scripting.Dictionary")
Range("G8:AH10") = vbNullString
 With Dict
 Do Until Month(My_date) <> [b4]
   If Weekday(My_date) <= 5 Then
    .Add My_date, ""
    End If
    My_date = My_date + 1
    x = .Count
  Loop
 End With
 With Range("G8")
 .Resize(, x) = Dict.keys
 .Offset(1).Resize(, x) = "Primary"
 .Offset(, x) = "Total"
 End With
 Dict.RemoveAll: Set Dict = Nothing
 Exit Sub
Wrong_data:
 MsgBox "Wrong_data:" & Chr(10) & _
   "Check the value Of $B$4 (Must be an integer between 1 and 12)" & Chr(10) & _
   "$B$5 (Must be an integer>1900)", 1048540, "Salim Tell You"
 
 
End Sub

file included

Daily Sales.xlsm

  • Like 1
رابط هذا التعليق
شارك

يعطيك العافية اخي

من حيث تغير الاشهر والتواريخ الشغل صحيح

لكن البيانات لما اغير الشهر لا تحفظ في الشهر التي كانت مسجلة

مثلا ادخلت بيانات في شهر مارس وحفظت الملف ثم اخترت شهر ابريل ومازالت البيانات تظهر

من المفترض ان مبيعات كل شهر تظهر في نفس الشهر وعند اختيار شهر جديد لا تظهر مبيعات الاشهر السابقة الا اذا اخترتها من القائمة

رابط هذا التعليق
شارك

6 ساعات مضت, ayman42001 said:

يعطيك العافية اخي

من حيث تغير الاشهر والتواريخ الشغل صحيح

لكن البيانات لما اغير الشهر لا تحفظ في الشهر التي كانت مسجلة

مثلا ادخلت بيانات في شهر مارس وحفظت الملف ثم اخترت شهر ابريل ومازالت البيانات تظهر

من المفترض ان مبيعات كل شهر تظهر في نفس الشهر وعند اختيار شهر جديد لا تظهر مبيعات الاشهر السابقة الا اذا اخترتها من القائمة

انا اشتغلت غلى هذا الشيء فقط

تغير الاشهر والتواريخ 

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information