Search:

Type: Posts; User: salim hasan; Keyword(s):

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Re: VBA draw table line borders every 18 count

    Erase Arr was entered by mistake after the End Sub
    it must be before
  2. Re: VBA draw table line borders every 18 count

    Same macro with variable range


    Option Explicit


    Sub test()
    Dim i%, k%, Arr(), Sub_Arr
    k = 1
    Const my_max = 50 'change to wanted number
  3. Re: VBA draw table line borders every 18 count

    Try this macro


    Option Explicit


    Sub Special_Borders()
    Dim Ar, Sub_Ar
    Cells(2, "T").Resize(20, 13).Borders.LineStyle = 0
    Ar = Array(2, 6, 8, 12, 14, 20)
  4. Re: Extract text between a character and first space left of that character.

    Try this formula


    =LEFT(REPLACE(A1,1,SEARCH(" *%",A1),""),SEARCH("%",REPLACE(A1,1,SEARCH(" *%",A1),""))-1)
  5. Replies
    10
    Views
    245

    Re: Cell contain multiple text

    Suppose your date in column(a),starting with A1
    Try this formula


    =IF(A1="","",IFERROR(INDEX({"HB";"FB"},CHOOSE(SUM(IF(A1="BB,DN",1,0),IF(A1="BB,DN,LN",2,0)),1,2)),"No Match"))

    ...
  6. Replies
    10
    Views
    2,266

    Re: arrays count unique items?

    What about this


    Option Explicit


    Sub CountUnique()
    Dim myArray As Variant
    Dim i As Long, Coll As New Collection
    myArray = Array("s", "e", "se", "sw", "s", "n", "ne", "ne", "s", "e",...
  7. Replies
    10
    Views
    2,266

    Re: arrays count unique items?

    Try this macro


    Option Explicit


    Sub How_Many_Unigues()
    Dim MY_Array, i%
    MY_Array = Array("s", "e", "se", "sw", "s", "n", "ne", "ne", "s", "e", "se")
    With...
  8. Replies
    5
    Views
    101

    Re: Embedded If Statements

    try this formula
    =CHOOSE(AND(UPPER(D5)="Y",UPPER(E5)="Y",UPPER(B5)="INACTIVE")+1,"",C5*$G$2)
  9. Re: Macro to retrieve data and to return in tabular form

    Try This Macro


    Option Explicit


    Sub One_table()
    Dim i%
    Dim t%: t = Sheets("sheet1").Cells(Rows.Count, 2).End(3).Row + 1
    Sheets("Sheet2").Range("B1").CurrentRegion.ClearContents
  10. Replies
    6
    Views
    218

    Re: Highlight the reverse patterns

    You can switch the code with this code because it is faster For empty cells



    Option Explicit
    Sub Count_For_Me()
    Const Col3 = 3
    Const Col4 = 4
    Dim i%, col%, k
    Dim last_ro%: last_ro =...
  11. Replies
    6
    Views
    218

    Re: Highlight the reverse patterns

    Try This Macro


    Option Explicit
    Sub Count_For_Me()
    Const Col3 = 3
    Const Col4 = 4
    Dim i%, col%, k
    Dim last_ro%: last_ro = Cells(Rows.Count, "C").End(3).Row
    Range("E6").Resize(last_ro - 5,...
  12. Re: VBA to copy data from different tabs to new sheet

    Type any thing in column(G) then try again
  13. Re: VLookUp ComboBox input to update TextBox values

    the complete macro


    Private Sub cmdContact_Click()
    On Error Resume Next
    If WorksheetFunction.CountIf(Sheet5.Range("B:B"), Me.cboName.Text) = 0 Then
    MsgBox "This client is not exist"...
  14. Re: VLookUp ComboBox input to update TextBox values

    try this



    Sub test()
    Dim t, x
    x = " #.00 L.L; - #.00 L.L;""Zero"" L.L"
    t = Format$(txtTotal.Value, x)
    txtTotal.Value = t
    End Sub
  15. Re: VLookUp ComboBox input to update TextBox values

    dim t,x
    x=" #.00 L.L; - #.00 L.L;""Zero"" L.L"
    t.txtTotal.Value
    t=t.NumberFormat(x)
    txtTotal.Value=t
  16. Re: VLookUp ComboBox input to update TextBox values

    Try


    Sub test()
    Range("D:D").NumberFormat = " #.00 L.L; - #.00 L.L;""Zero"" L.L"
    End Sub
  17. Re: VLookUp ComboBox input to update TextBox values

    the right for .txtTotal.Value is



    .txtTotal.Value = Application.WorksheetFunction.VLookup(Me.cboName.Text, Sheet5.Range("A1").CurrentRegion.Offset(,1), 4, 0)
  18. Re: VBA to copy data from different tabs to new sheet

    At least One of The other sheets must has data
    in A1 date like (1/1/2019) , in range (G1: G5) for example any data
    and in cells H1 any thing (No empty)
  19. Re: VBA to copy data from different tabs to new sheet

    create a sheet with name data_store and try this macro



    Option Explicit


    Sub test()
    Dim CheckA, CheckG, CheckH
    Dim g%, lr%, x, m%: m = 2
  20. Replies
    9
    Views
    212

    Re: if funcction problem need solving

    Can you Try My Formula


    =INDEX({"Gap to 1st & Gap to 3rd"," Gap to 2nd & Gap to 3rd","Gap to 1st & Gap to 2nd ","No Gap "},MATCH(B1&" "&C1&" "&D1,{"Gap to 1st No Gap Gap to 3rd","No Gap Gap to...
  21. Replies
    6
    Views
    144

    Re: Sum If, for duplicates?

    Try this formula


    =SUMPRODUCT(($A$1:$A$6=$D1)*($B$1:$B$6))
  22. Re: VBA Code to Protect/Un-Protect Sheets asking for a password when there isn't one

    try Do this
    1- insert a CommandButton with name My_Button for example (ActiveX controls)
    2 -try to run this macro by pressing the button


    Sub test()
    Sheets("sheet1").Protect Password:="pass",...
  23. Re: VBA Code to Protect/Un-Protect Sheets asking for a password when there isn't one

    You must use the method UserInterfaceOnly:=True
    with can run The macro in protected sheet
    like this example


    Option Explicit


    Sub Protect_sh()
    Dim i
  24. Re: How to split units from numbers stored in a cell that is custom formatted

    What About This Macro


    Option Explicit
    Sub test()
    Dim obj As Object, lr%, i%, I_find


    Set obj = CreateObject("VBScript.RegExp")
    lr = Cells(Rows.Count, 1).End(xlUp).Row
  25. Re: How to split units from numbers stored in a cell that is custom formatted

    What about this macro


    Option Explicit
    Sub test()
    Dim obj As Object, lr%, i%, Ys
    Set obj = CreateObject("VBScript.RegExp")
    lr = Cells(Rows.Count, 1).End(xlUp).Row
    obj.Pattern = "(\.\d*)"
    ...
Results 1 to 25 of 102
Page 1 of 5 1 2 3 4