Basic Understanding of Macro [Worksheet, Range, Cells ... - Excel Prince
Here are some VBA Code.... You may learn it from my exclusive channel @ free of cost
Here are is the URL of the Video and Code which are used the files
Basic Understanding of Macro [Worksheet, Range, Cells, Columns, Rows]
Sub refersheet() Worksheets(2).Select End Sub
Sub refersheet2() Worksheets("Prince").Select End Sub
Sub refersheet3() Sheet2.Activate End Sub
Sub range1() Range("A1").Select End Sub
Sub range2() Range("A1:b10").Select End Sub
Sub range3() Range("A1:b10,e2:E9").Select End Sub
Sub column1() Range("A:A").Select End Sub
Sub Row1() Range("1:1").Select End Sub
Sub column2() Range("A:c").Select End Sub
Sub Row2() Range("1:5").Select End Sub
Sub Row3() Range("1:1,3:3,5:5").Select End Sub
Sub column5() Range("A:A,c:c,F:F").Select End Sub
Sub cells1() Cells(5, 2).Select End Sub
------------------------------------------------------------------- -------------------------------------------------------------------------
Learn If, Else-if, Nested Elseif, Nested ifs
Sub Simpleif() Dim i As Integer i = Range("G3").Value
If i = 1 Then Range("A1").CurrentRegion.Font.Bold = True Range("A1").CurrentRegion.Font.Name = "Times new Roman" Range("A1").CurrentRegion.Font.ColorIndex = 5
End If
End Sub
Sub Simpleif1() Dim i As Integer i = Range("G3").Value
If i = 1 Then Range("A1").CurrentRegion.Font.Bold = True Range("A1").CurrentRegion.Font.Name = "Times new Roman" Range("A1").CurrentRegion.Font.ColorIndex = 5
Else Range("A1").CurrentRegion.Font.Bold = False Range("A1").CurrentRegion.Font.Name = "Arial" Range("A1").CurrentRegion.Font.ColorIndex = 3
End If End Sub
Sub Simpleif3() Dim i As String i = Range("G6").Value
Range("A1").CurrentRegion.ClearFormats If i = "Red" Then
Range("A1").CurrentRegion.Style = "Accent2" ElseIf i = "Green" Then
Range("A1").CurrentRegion.Style = "Accent3" ElseIf i = "Orange" Then
Range("A1").CurrentRegion.Style = "Accent6" ElseIf i = "Blue" Then
Range("A1").CurrentRegion.Style = "Accent5" Else
Range("A1").CurrentRegion.Style = "Accent4" End If
End Sub
Sub message() MsgBox "Hi Dear How are You", vbInformation + vbYesNo, "Prince Sethi"
End Sub
Sub Nestedif() Dim rep As String rep = MsgBox("Dear do you want to colour your data", vbYesNo, "Question Reply please")
If rep = vbYes Then Call Simpleif3
Else MsgBox "Dear you have pressed No Button so i will not apply any colour"
End If End Sub
----------------------------------------------------------------------------------------------------------------------------- ---------------
While Loop with Examples
Sub Whleloop1() Dim i As Integer Dim r As Integer i = 1 r = 8
While i = 1
Sheet1.Range("B" & r).Value = i i = i - 1 r = r + 2 Wend End Sub
Sub Whilelop3() Dim x As Integer Dim y As Integer Dim r As Integer Dim s As Integer
r = 9
While Range("A" & r).Value "" x = Range("A" & r).Value y = Range("B" & r).Value s = x + y Range("C" & r).Value = s r = r + 1
Wend End Sub ----------------------------------------------------------------------------------------------------------------------------- ---------------
Lets Learn For Loop with Different-2 Example
Z1f0
Sub Forloop1() Dim t As Integer Dim i As Integer Dim s As Integer Dim r As Integer
t = 5 i = 1 r = 7
For i = 1 To 10 s = t * i Sheet1.Range("A" & r).Value = s r = r + 1
Next i End Sub
Sub Type1() Dim i As Integer
For i = 1 To 12 Sheets(i).Select Sheets(i).Range("D6").Value = "Lets Learn VBA Together"
Next i End Sub
Sub forloop2() Dim i As Integer
For i = 1 To 12 Sheets(i).protect "Prince"
Next i End Sub
Sub forloop3() Dim i As Integer
For i = 1 To 12 Sheets(i).Unprotect "Prince"
Next i End Sub
Sub Forloop4() Dim i As Integer
For i = 1 To 12 Sheets(i).Name = Sheet1.Range("T" & i).Value
Next i End Sub
Sub forloop5() Dim i As Integer Dim r As Integer
r = 10
For i = 1 To 56 Range("C" & r).Value = i Range("D" & r).Interior.ColorIndex = i r = r + 1
Next i End Sub
Lets Learn Nested For Loop , Dual For loop
Z1f0
Sub dualforloop() Dim t As Integer Dim i As Integer Dim s As Integer
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- a guide to excel and fme safe software
- learn vba for excel
- vba cheat sheets
- basic understanding of macro worksheet range cells excel prince
- porting excel vba to calc starbasic
- excel 2019 basic quick reference
- monte carlo simulation using excel
- sugi 25 using sasr and dde to execute vba macros in excel
- microsoft excel vba free training manual
- 20 useful excel macro examples
Related searches
- basic understanding of financial statements
- list of macro functions
- percentage of three or more cells excel
- basic understanding of genetics
- basic understanding of electricity
- date range in excel cell
- basic understanding of philosophy
- history of macro social work
- types of macro practice in social work
- types of macro interventions
- examples of macro interventions
- examples of macro social work