Posts

Day 02 Python - data types , Numbers , Operations , Type Conversions , f-Strings

https://repl.it/@appbrewery/ day-2-start  LEC 18 - Intro of todays goals  ================================================================== LEC 19 - Data Type 1 - Strings    Any thing Written in " "  (double Quotes) and ' ' (Single Quotes)   -----------------------------------------------------------------------------------------------------------------------  2 - Integers          # Any Whole number in programming is known as INTEGERS ------------------------------------------------------------------------------------------------------------------------ 3 - Float            3.145   ------------------------------------------------------------------------------------------------------------------------- 4 - Boolean  True False  #  First Letter should be capital -------------------------------------------------------------------------------------------------------------...

PY MOD01 Lecture 01

 Coding Room ID -- rk.180497@gmail.com Pass - Ritesh@1804 https://app.codingrooms.com/management/courses/join-by-code/4J6slZE6 https://app.codingrooms.com/management/courses/6387/classes/8480/assignments https://replit.com/account ID - RiteshKumar144 ,  rk.180497@gmail.com Pass -  ================================================================== 1 0 0 D A Y S O F C O D E SYLLABUS BASIC Variables in Python String Manipulation Input and Print Functions Variable Naming Rules Mathematical Operations in Python DataTypes Converting types Conditionals IF/ELIF/ELSE Logical Operators Randomisation Error Handling Functions For Loops Code blocks and Indentation While Loops Flowchart Programming Positional and Keyword Arguments Python Dictionaries and Lists Nested Collections Returning Functions Return vs. Print Doc Strings vs. Comments Scope and Local/Global Variables Debugging Techniques     INTERMEDIATE       Local Development Environment Setup Py...

VBA MOD 01 nested loop - Loop through each cell value and each row

Image
Option Explicit Const startrow As Byte = 10 Dim lastrow As Long Public Sub For_Next_loop_in_text()     Dim i As Long 'for looping inside each cell     Dim numfound As Long     Dim textfound As String     Dim myValue As String     Dim r As Long 'looping through each rows lastrow = Range("A" & Rows.Count).End(xlUp).Row        For r = startrow To lastrow     myValue = Range("A" & r).Value     For i = 1 To VBA.Len(myValue)        If IsNumeric(VBA.Mid(myValue, i, 1)) Then        numfound = numfound & VBA.Mid(myValue, i, 1)                ElseIf Not IsNumeric(VBA.Mid(myValue, i, 1)) Then        textfound = textfound & VBA.Mid(myValue, i, 1)        End If             Next i     Range("H" & r).Value = numfound     Range...

VBA MOD 01 Project Acvtivity : Count total number of formulas in Workbook

Image
 Option Explicit Public Sub Count_WB_formulas_error_Handling() Dim Sh As Worksheet Dim CounterWS As Double Dim CounterGlobal As Double For Each Sh In ThisWorkbook.Worksheets     On Error GoTo Errorhandle            CounterWS = Sh.Cells.SpecialCells(xlCellTypeFormulas).Count Lable1:  CounterGlobal = CounterGlobal + CounterWS      Errorhandle:     If Err.Number = 1004 Then     CounterWS = 0     Resume Lable1     End If      Next Sh MsgBox CounterGlobal End Sub

VBA MOD01 Passing Arguments to sub procedures (ByRef , By Val)

Image
  Private Sub myCalc(Getvalue As Double, myPercent)          Getvalue = Getvalue * myPercent     MsgBox Getvalue      End Sub Public Sub GetMyValue()     Dim myValue As Double     Dim p As Variant     'assign value and percentage from cell     myValue = Range("A8").Value     p = Range("B8").Value     Call myCalc(myValue, p)     MsgBox myValue      End Sub ========================================================================= Private Sub myCalc(Getvalue As Double, myPercent)          Getvalue = Getvalue * myPercent     MsgBox Getvalue      End Sub Public Sub GetMyValue()     Dim myValue As Double     Dim p As Variant     'assign value and percentage from cell     myValue = Range("A8").Value     p = Range("B8").Value     If Excel.WorksheetF...

VBA 01 Methods to debug Code

Image

VBA MOD01 Project Activity Show top 3 value on Message box based on range selected

Image
 Project Activity Show top 3 value Dim myRange As Range Dim Top1 As Double, Top2 As Double, Top3 As Double Dim msg As Long On Error GoTo leave Set myRange = Application.InputBox(Prompt:="Select the range of no to get top 3 values", _ Title:="Top3..", Type:=8) If Application.WorksheetFunction.Count(myRange) > 2 Then     Top1 = Excel.WorksheetFunction.Large(myRange, 1)     Top2 = Excel.WorksheetFunction.Large(myRange, 2)     Top3 = Excel.WorksheetFunction.Large(myRange, 3)          msg = MsgBox _     (Prompt:="Here is the top three values" & vbNewLine & "Top1" _     & " " & Top1 & vbNewLine & "Top2" & " " & Top2 & _     vbNewLine & "Top3" & " " & Top3, _     Title:="Here is the Top 3 values", Buttons:=vbOKOnly) Else MsgBox "please select at least 3 cells with numbers", vbInformation leave: End If End Sub