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

طلب مساعدة activecell - for


amrmhy82

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

السلام عليكم

برجاء المساعدة 

عمودين اريد اختيار خليتين منها (activecell) عمود تاريخ وعمود كود 

عمود الكود متكرر الصفوف وعمود التاريخ غير متكرر

cmdbutton1_click                                                        
    Dim oo As Worksheet
    For Each oo In ThisWorkbook.Worksheets  
    For Each u In oo.Range("a2:a1000")                                   
    For Each Y In oo.Range("c2:c1000")   
    If y = ComboBox1.Text Then  
    oo.Select  
    u.Select     
    Y.Select   
    Exit For  
    End If  
    Next Y  
    Next u  
    Next oo  
    ActiveCell.Value = ComboBox1.Value  
    TextBox1.Value = ActiveCell.Offset(0, 1).Value
end sub

هذا الكود حاولت فيه ..مرة يقف عند اول بحث ومرة يستكمل لاخر صف ...اريد تعديل الكود---وشكرااا

 

 

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

ولكن الكود مكرر في ملفك والتاريخ ايضا

اذا كان ذلك مقصود فانصحك باستعمال الليستبوكس في البحث بدل الكومبوبوكس 

يعني فورم يحتوي على textbox للبحث بالكود

و listbox  لاطهار نتيجة البحث

عند عمل كليك على اي صف داخل  listbox  يحدد الخلية في الشيت لي فيه نقس الكود في نفس row

اعطيني قليل من الوقت لاجهز تجربة عن هذا

وهذه تجربة 

جرب ورد

active cell.xlsm

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

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