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

lionheart

الخبراء
  • Posts

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

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

  • Days Won

    27

كل منشورات العضو lionheart

  1. In worksheet module put the following code Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row > 2 And (Target.Column = 5 Or Target.Column = 6) Then Application.EnableEvents = False Target.Value = Target.Value / 24 Application.EnableEvents = True Target.NumberFormat = "hh:mm" End If End Sub
  2. Press Alt + F11 to login VBE editor From Insert menu select Module Paste the code Back to the worksheet and press Alt + F8 and click Run th execute the code
  3. Sub Test() Dim r As Long, m As Long Application.ScreenUpdating = False r = 1: m = 7 Do Cells(m, 4).Resize(, 6).Value = Application.Transpose(Cells(r, 1).Resize(6).Value) m = m + 1: r = r + 6 Loop Until r >= Cells(Rows.Count, 1).End(xlUp).Row Application.ScreenUpdating = True End Sub
  4. The question is not related to the main question Anyway this line will print the activesheet ActiveSheet.PrintOut You asked for a fomula to print (that is too weird) Generally you can press Ctrl + P to print without any formulas or codes
  5. In Data tab select data validation and select Custom and finally insert a formula like that =OR((A1="A"),AND(A1>=0,A1<=70)) Change the A letter with the absent character in arabic
  6. First unprotect the worksheet Select cell B8 which is related to the scroll bar form control > Right-click the cell > Format Cells > Protection tab > Uncheck the Locked option Finally protect the worksheet again
  7. You can directly use this line if you don't care about empty items MsgBox ListBox1.ListCount
  8. Private Sub UserForm_Initialize() ListBox1.List = Range("A2:C11").Value End Sub Private Sub CommandButton1_Click() Dim c As Integer, i As Integer, t As Double Rem First Column In ListBox = 0 c = 0 For i = 0 To ListBox1.ListCount - 1 If ListBox1.List(i, c) <> Empty Then t = t + 1 Next i MsgBox t End Sub
  9. You can change number 1 in this line with 3 .Range("A3").Resize(x, 1) = temp
  10. Insert a module and paste the following UDF Function AutoSum(rng As Range) As Variant Dim ws As Worksheet AutoSum = 0 Application.Volatile True For Each ws In Worksheets If Not ws Is Application.ThisCell.Parent Then AutoSum = AutoSum + ws.Range(rng.Address) End If Next ws End Function Then in Total worksheet you can use the formula like that (example in cell A9 put the formula) =AutoSum(A9)
  11. The code will work only if you change any cell in column T manually and the code will not be triggered when copying more than one cell Try deleting the first line in the code
  12. The code is put in worksheet module not in standard module Right-click worksheet name and select [View Code] then paste the code I posted
  13. In worksheet module Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.CountLarge > 1 Then Exit Sub If Target.Row > 2 And Target.Column = 20 Then Application.Goto Cells(Target.Row + 1, 2) End If End Sub
  14. Replace this line Range("a10:u" & Cells(Rows.Count, "u").End(xlUp).Row).Copy With this line Range("a10:u21").Copy
  15. In worksheet module Private Sub Worksheet_Change(ByVal Target As Range) Dim x If Target.Address = "$A$1" Then Columns("B:AT").Hidden = False If Target.Value = Empty Then Target.Select: Exit Sub x = Application.Match(Target.Value2, Rows(3), 0) If Not IsError(x) Then Columns("B:AT").Hidden = True Columns(x).Hidden = False End If Target.Select End If End Sub
  16. Sub Test() Dim a, temp, dict As Object, buy As Double, sell As Double, i As Long, x As Long Set dict = CreateObject("Scripting.Dictionary") With Sheets("Sheet1").Cells(2).CurrentRegion a = .Value: ReDim temp(1 To UBound(a), 1 To 3) For i = 2 To UBound(a) If Not dict.Exists(a(i, 1)) Then dict.Add a(i, 1), "" buy = Application.WorksheetFunction.SumIfs(.Columns(7), .Columns(1), a(i, 1), .Columns(2), "BUY") sell = Application.WorksheetFunction.SumIfs(.Columns(7), .Columns(1), a(i, 1), .Columns(2), "SELL") If buy > sell Then x = x + 1: temp(x, 1) = a(i, 1): temp(x, 2) = buy: temp(x, 3) = sell End If Next i End With With Sheets("Sheet2") .Columns(1).ClearContents .Range("A2").Value = "Market" .Range("A3").Resize(x, 1) = temp End With End Sub
  17. Put the following line before the line of Next Next Should be If [E13] = 0 Then Exit For ActiveWindow.SelectedSheets.PrintOut Copies:=1 Next
  18. Private Sub CommandButton1_Click() ActiveCell.FormulaR1C1 = "10" TextBox1.Text = ActiveCell.FormulaR1C1 ExcelSpeak TextBox1.Text ActiveCell.Offset(1, 0).Select End Sub Function ExcelSpeak(sIn As String) As Boolean Application.Speech.Speak sIn, 0, 0, 0 ExcelSpeak = True End Function
  19. Sub Test() Const nRows As Integer = 25, iRow As Integer = 15 Dim wb As Workbook, ws As Worksheet, sh As Worksheet, i As Integer Application.ScreenUpdating = False Set ws = ActiveSheet Set wb = Workbooks.Add(xlWBATWorksheet) For i = 1 To 10 ws.Range("A" & iRow).Value = (i - 1) * nRows + 1 If ws.Range("B" & iRow).Value = Empty Then Exit For ws.Copy After:=wb.Sheets(wb.Worksheets.Count) Set sh = ActiveSheet sh.Name = i With ws.Range("A" & iRow & ":BF39") .Copy sh.Range("A" & iRow).PasteSpecial xlPasteValues sh.Columns("BG:BH").Delete Application.Goto sh.Range("A1"), True End With Next i Application.DisplayAlerts = False With ActiveWorkbook .Worksheets(1).Delete .SaveAs ThisWorkbook.Path & "\Output", 51 .Close False End With Application.DisplayAlerts = True Application.ScreenUpdating = True MsgBox "Done", 64 End Sub
  20. Thanks a lot my bro Hassona for your reply that explains the correct steps
×
×
  • اضف...

Important Information