اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

حسونة حسين

أوفيسنا
  • Posts

    961
  • تاريخ الانضمام

  • تاريخ اخر زياره

  • Days Won

    27

مشاركات المكتوبه بواسطه حسونة حسين

  1. السلام عليكم ورحمه الله وبركاته وبها نبدأ

     

    Option Explicit
    'http://www.mrexcel.com/archive/VBA/24009.html
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
    
    Private Const GWL_STYLE As Long = (-16) 'Sets a new window style
    Private Const WS_SYSMENU As Long = &H80000 'Windows style
    Private Const WS_MINIMIZEBOX As Long = &H20000
    Private Const WS_MAXIMIZEBOX As Long = &H10000
    Private Const SW_SHOWMAXIMIZED = 3
    
    Private Sub UserForm_Activate()
    Dim lFormHandle As Long, lStyle As Long
    '===========================================
    '= Originally from Dax =
    '= Modified with comments by Ivan F Moala =
    '= 22/07/01 =
    '===========================================
    
    'Lets find the UserForm Handle the function below retrieves the handle
    'to the top-level window whose class name ("ThunderDFrame" for Excel)
    'and window name (me.caption or UserformName caption) match the specified strings.
    lFormHandle = FindWindow("ThunderDFrame", Me.Caption)
    
    'The GetWindowLong function retrieves information about the specified window.
    'The function also retrieves the 32-bit (long) value at the specified offset
    'into the extra window memory of a window.
    lStyle = GetWindowLong(lFormHandle, GWL_STYLE)
    
    'lStyle is the New window style so lets set it up with the following
    lStyle = lStyle Or WS_SYSMENU 'SystemMenu
    lStyle = lStyle Or WS_MINIMIZEBOX 'With MinimizeBox
    lStyle = lStyle Or WS_MAXIMIZEBOX 'and MaximizeBox
    
    'Now lets set up our New window the SetWindowLong function changes
    'the attributes of the specified window , given as lFormHandle,
    'GWL_STYLE = New windows style, and our Newly defined style = lStyle
    SetWindowLong lFormHandle, GWL_STYLE, (lStyle)
    
    'Remove >'< if you want to show form Maximised
    'ShowWindow lFormHandle, SW_SHOWMAXIMIZED 'Shows Form Maximized
    
    'The DrawMenuBar function redraws the menu bar of the specified window.
    'We need this as we have changed the menu bar after Windows has created it.
    'All we need is the Handle.
    DrawMenuBar lFormHandle
    
    End Sub
    

     

  2. السلام عليكم ورحمة الله وبركاته وبها نبدأ 

    اسم الطالب 

    محمد مكرر مرتين

    هل عند الترحيل سوف يكرر الاسم ؟

    ام ماذا سوف يحدث؟

    اسم الطالب محمد مكرر مرتين

    في عامودين مختلفين هل عند الترحيل سوف يتم الترحيل ايضا الى عامودين ام ماذا ؟

    اضف المذيد من الاسماء والبيانات في ملفك 

    مع وضع كيف هى شكل النتائج 

    لكى يفهم الاخوة ماذا تريد حتى تجد المساعده المطلوبه

  3. تفضل اخى الكريم 

    Option Explicit
    
    Sub Transfer_Non_Adjacent_Columns_Using_Arrays_YasserKhalil_ExcelEgy()
    'Code by MR.Yasser Khalil
    'From page https://www.excel-egy.com/forum/t3892
        Dim WB As Workbook, WS As Worksheet, SH As Worksheet
        Dim arr As Variant, i As Variant, cr As Variant, j As Long
        Dim LR As Long
        Set SH = ThisWorkbook.Worksheets("ترحيل يومية")
        Set WB = Workbooks.Open(ThisWorkbook.Path & "\" & "العملاء.xlsm")
        Set WS = WB.Worksheets(SH.Range("D2").Value)
    
        arr = SH.Range("A5:F" & SH.Cells(Rows.Count, 1).End(xlUp).Row).Value2
        cr = Array(8, 9, 10, 11, 12, 4)
        LR = WS.Cells(Rows.Count, 11).End(xlUp).Row + 1
        For Each i In Array(1, 2, 3, 4, 5, 6)
            WS.Cells(LR, cr(j)).Resize(UBound(arr, 1)).Value = Application.Index(arr, , i)
            j = j + 1
        Next i
        WS.Range("K:K").NumberFormat = "[$-1010000]yyyy/mm/dd;@"
        WB.Close Savechanges:=True
    End Sub

     

    • Like 1
×
×
  • اضف...

Important Information