BoraAyper
BoraAyper
Reputation Top 1%
Bora Ayper
15 Snippets  (53rd place)
Published
1 Channel
Created
6 Channels
Following
309 points  (100th place)
Reputation
Top 10% Publisher
Junior Code Generator
Serious Code Generator
Senior Code Generator
Junior Autobiographer
Senior Autobiographer

Recent Snippets See all snippets by BoraAyper

public by BoraAyper  18  0  1  0

vba object properties Get-Let

// Enter here the actual content of the snippet.					


//Private olarak property olarak gelecek deger uzerinde kontrol saglayacagimiz
// degisken yap
Private p_alan_kaca_bolunecek As Integer

// bu alttaki olaylar bu deger uzerinfde kontrol saglamak icin
//mesela bolunecek alan 100 u gecmeyecek diyeceksek bu get let de belirleyebiliriz
Public Property Get alan_kaca_bolunecek() As Integer
    alan_kaca_bolunecek = p_alan_kaca_bolunecek
End Property

Public Property Let alan_kaca_bolunecek(Value As Integer)
    p_alan_kaca_bolunecek = Value
End Property
;

public by BoraAyper  15  0  1  0

call module

// Enter here the actual content of the snippet.

Call Module2.Bora_EMA_Optimizer(Range("t1"), Range("t2"), Range("t11"), Range("t12"), Range("t13"), Range("t14"), Range("q10"), Range("q11"), Range("q12"), Range("q13"), Range("q9"))
;

public by BoraAyper  23  0  1  0

Get RowNum

// Enter here the actual content of the snippet.						

Function GetRowNum(Simpson_son_tarih)
Dim lrow As Long

    //Specifies that when a run-time error occurs, control goes to the statement immediately following 
    //the statement where the error occurred, and execution continues from that point. Use this form rather than On Error GoTo when accessing objects.
    On Error Resume Next
    lrow = Application.WorksheetFunction.Match(Simpson_son_tarih, Worksheets("Data").Range("a1:a5000"), 0)
    
    //Disables enabled error handler in the current procedure and resets it to Nothing.
    On Error GoTo 0
    
    If lrow > 0 Then
        'code
    GetRowNum = lrow
    
    End If

End Function         
;

public by BoraAyper  27  1  1  0

For Each Cell usage

// Enter here the actual content of the snippet.						

Range("o1:ab3000").ClearContents
Range("m20:n22").ClearContents

'-------------------------------
Set WS = Worksheets("EMA Analiz (2)")
With WS
    Set LastCella = .Cells(.Rows.Count, "a").End(xlUp)
    
    lastcellrownumber = Application.WorksheetFunction.max(LastCella.Row)
End With
'----------------------------------------------
Set rng = Worksheets("EMA Analiz (2)").Range("E2:E" & lastcellrownumber)

sonuc_satiri_arti_bir = 0
'-----------------------------------------

For Each cll In rng
....
Next cll
;

public by BoraAyper  22  1  1  0

VBA random function

// Enter here the actual content of the snippet.	

Range("t1") = Rnd() * -1
Range("t2") = Rnd()

Range("t3") = Application.WorksheetFunction.RandBetween(-25, 0)
Range("t4") = Application.WorksheetFunction.RandBetween(-5, 30)

Range("t7") = Application.WorksheetFunction.RandBetween(50, 70)
Range("t8") = Application.WorksheetFunction.RandBetween(60, 90)

Range("t9") = Rnd(1) * -1
Range("t10") = Rnd(1)
;