Excel VBA

(full-width) Excel VBA

VBA

  1. First On the Developer Option in Excel.
  2. vba code to [ write the name of the task].
  3. vba code to split table by columns
  4. Vba code to convert numbers in words rupees
  5. Vba code to combine multiple workbooks

Convert number into word

  1. =SpellCurr(Select cell);
  2. Ctrl + shift ++ (then rows are enter)
  3. Ctrl + H (Used for Find and Replacement)

Vba code to insert rows on the based on cell value

  1. It would help you to adding the rows below in the excel

Do Until Loop VBA Excel Macro

  1. It would help you to adding the rows below in the excel
  2. Find and Replace you can add the name of macros then you perform the action.
Sub FindandReplace()
Dim x As Integer
x = 0
Do Until x = 10

    Selection.Replace What:=x, Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
        x = x + 1
        Loop
End Sub

Do While Loops or For Next Excel VBA

  1. Do While Loops is used when we have the given data in the the cell of large amount then we have cancel the numbers in the data then we use the Do while loop.
Sub dowhile()
Dim x As Integer
x = 0
Do While x < 10

    Selection.Replace What:=x, Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
        x = x + 1
        Loop
End Sub

Same Work Done using ForNext Loop

Sub forNext()
Dim x As Integer
For x = 0 to 9
    Selection.Replace What:=x, Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
Next
End Sub

User Defined Functions (UDF)

System Defined Function are those functions who has defined but the user defined function are not defined and the user defined this functions.What can User Defined Functions (UDF) do?

  1. SUM by cell color
  2. COUNT by cell color
  3. Extract cell Comments
  4. Convert Number to words in Rupees
  5. Extract Email ID From LinkedIn Comments
  6. Extract text from a cell
  7. System Defined Function User Defined Functions
    =SUM( )
    =SpellRupee( ) //Number to Ruppees
    =MATCH( )
    =TRIM(SpellRupee())
    =AVERAGE( )
    =GetComments()
Basic Structure of UDF
Function function_name(rng As Range) As String

End Function

Post a Comment

Post a Comment (0)

Previous Post Next Post