SlideShare a Scribd company logo
1 of 15
CODE TO INSERT SHAPE
Sub Rectangle_Shape()
' Code to insert shape
ActiveSheet.Shapes.AddShape msoShapeRectangle, 0, 0, 200, 200
End Sub
INSERT RECTANGLE
THANK YOU
CODE CONCATENATE
Sub concatenate()
‘Applying Concatenate formula by using “range”
Range("a3").Value = Range("a1") & " " & Range("a2").Value
End Sub
CODE CONCATENATE
THANK YOU
Sub concatenate ()
‘Applying Concatenate formula by using “Cells”
Cells(3, 1).Value = Cells(1, 1) & " " & Cells(2, 1).Value
End Sub
OR
CODE FOR DYNAMIC VLOOKUP
Dynamic Vlookup include 3 step:
1) Identifying Last Visible Cell till which Vlookup formula will run
2) Identifying the table range for Vlookup
3) Loop code to execute “Vlookup” formula till last visible cell
CODE FOR DYNAMIC VLOOKUP
NEXT: CODE FOR LAST VISIBLE CELL
1: COUNT CELL
• It important to find count visible row cell so that when programme runs
“Vlookup Formula” it may known were to stop.
• Vlookup helps to find the value from Other workbook/sheets or from
same sheet with the help of unique reference and therefore reference is
important incase of it absence there will be an error.
• If we not find the last cell till which “Vlookup formula” should run, then it
may continue to run through out the sheet till the last cell of the sheet.
NEXT: COUNT VISIBLE ROW CELL
Sub Count_Visible_row()
'This code help to find only last visible row by counting all visible cell. But
it do not count last visible column
Dim Count_cell As Integer
Dim Row_Range As String
Sheet1.Select
Count_cell = WorksheetFunction.CountA(Range("A:A"))
End Sub
COUNT VISIBLE ROW CELL
NEXT: CODE FOR LAST VISIBLE ROW
CELL & RANGE
2: TABLE_ARRAY OR TABLE RANGE
• Table Array or a Range from which value is to be looked should be
dynamic means, Range should include any new row/column or exclude
any newly deleted row/column automatically.
• To do that we need run a code before executing Vlookup formula, which
help to find the last Row Cell & Last Column Cell.
• Finding of Last Row & Column will helps to formulate a Table Array or
Range from which value is to be looked.
NEXT: CODE FOR LAST VISIBLE BOTH
ROW & COLUMN
Sub last_Visible_row()
' This code help to find only last visible row by counting all visible cell. But it
do not count last visible column
Dim Lastcell As String
Dim Row_Range As String
Lastcell = Range("a1").End(xlDown).Address
MsgBox (Lastcell)
Row_Range = Range("A1:" & Lastcell).Address
MsgBox (Row_Range)
End Sub
CODE FOR LAST VISIBLE ROW CELL & RANGE
NEXT: CODE FOR LAST VISIBLE COLUMN
CELL & RANGE
Code helps to find the
address of last cell in
Row
Code helps to find the
row’s range address
Sub last_Visible_column()
' This code help to find only last visible row by counting all visible cell. But it
do not count last visible column
Dim Lastcell As String
Dim Column_Range As String
Lastcell = Range("a1").End(xlToRight).Address
MsgBox (Lastcell)
Column_Range = Range("A1:" & Lastcell).Address
MsgBox (Column_Range)
End Sub
CODE FOR LAST VISIBLE COLUMN
CELL & RANGE
NEXT: CODE FOR LAST VISIBLE
ROW CELL & RANGE
Code helps to find the
address of last cell in
Column
Code helps to find the
column’s range address
Sub last_Visible_Row_Column()
'This code help to find only last visible row by counting all visible cell. But it
do not count last visible column
Dim Lastcell_Row As String
Dim Lastcell_Column As String
Dim Table_Range As String
Lastcell_Row = Range("a1").End(xlDown).Address
Lastcell_Column = Range("a1").End(xlToRight).Address
Table_Range = Range(Lastcell_Row & ":" & Lastcell_Column).Address
MsgBox (Table_Range)
End Sub
NEXT: CODE FOR LAST VISIBLE BOTH
ROW & COLUMN
NEXT: CODE FOR LAST VISIBLE BOTH
ROW & COLUMN
3: LOOP FOR VLOOKUP
• Loop is use to perform same repetitive work.
• Loop can be customized by providing condition to it.
• Inserting Vlookup formula in each cell of row is an continuous process.
And therefore to perform such repetitive work Loop are used
NEXT: “FOR LOOP” FOR VLOOKUP
Sub Loop_for_Vlookup()
'Count the number cell in which Vlookup need to performed which can be done through last cell visible code
which we have done in previous slide.
Dim count_Cell As Integer 'Insert Count Cell code to count no. of Visible Rows for Vlookup
Dim Lastcell_Row As String 'Code to Identify last cell of row to form dynamic table array
Dim Lastcell_Column As String 'Code to Identify last cell of column to form dynamic table array
Dim Table_Range As String 'Code to combine result from Last cell Row and Last Cell Column
Dim reference As String 'code for reference of cell for which valued are looked up
For j = 1 To count_Cell
reference = ("$A" & j)
ActiveCell.Formula = "=VLOOKUP(" & reference & ",Sheet1!" & Table_Range & " ,2,0)"
ActiveCell.Offset(1, 0).Select
Next j
End Sub
“FOR LOOP” FOR VLOOKUP
NEXT: DYNAMIC VLOOKUP
DYNAMIC VLOOKUP
Sub Dynamic_Vlookup()
Dim count_Cell As Integer
Dim reference As String
Dim Lastcell_Row As String
Dim Lastcell_Column As String
Dim Table_Range As String
Sheet2.Select
count_Cell =
WorksheetFunction.CountA(Range("A:A"))
Sheet1.Select
Lastcell_Row =
Range("a1").End(xlDown).Address
Lastcell_Column =
Range("a1").End(xlToRight).Address
Table_Range = Range(Lastcell_Row & ":" &
Lastcell_Column).Address
MsgBox (Table_Range)
Sheet2.Select
Range("B1").Select
For j = 1 To count_Cell
reference = ("$A" & j)
ActiveCell.Formula = "=VLOOKUP(" & reference &
",Sheet1!" & Table_Range & " ,2,0)"
ActiveCell.Offset(1, 0).Select
Next j
End Sub

More Related Content

What's hot

What's hot (20)

The Functional Programming Triad of fold, scan and iterate
The Functional Programming Triad of fold, scan and iterateThe Functional Programming Triad of fold, scan and iterate
The Functional Programming Triad of fold, scan and iterate
 
The Stack And Recursion
The Stack And RecursionThe Stack And Recursion
The Stack And Recursion
 
Stacks Implementation and Examples
Stacks Implementation and ExamplesStacks Implementation and Examples
Stacks Implementation and Examples
 
Stack application
Stack applicationStack application
Stack application
 
Introduction to stack
Introduction to stackIntroduction to stack
Introduction to stack
 
String function in my sql
String function in my sqlString function in my sql
String function in my sql
 
11 15 (doubly linked list)
11 15 (doubly linked list)11 15 (doubly linked list)
11 15 (doubly linked list)
 
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
 
Getting started in c++
Getting started in c++Getting started in c++
Getting started in c++
 
Array Presentation (EngineerBaBu.com)
Array Presentation (EngineerBaBu.com)Array Presentation (EngineerBaBu.com)
Array Presentation (EngineerBaBu.com)
 
Functions
FunctionsFunctions
Functions
 
Introduction To Stack
Introduction To StackIntroduction To Stack
Introduction To Stack
 
programming for Calculator in java
programming for Calculator in javaprogramming for Calculator in java
programming for Calculator in java
 
Compiler Design Lab File
Compiler Design Lab FileCompiler Design Lab File
Compiler Design Lab File
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
 
stack presentation
stack presentationstack presentation
stack presentation
 
Stacks fundamentals
Stacks fundamentalsStacks fundamentals
Stacks fundamentals
 
skip list
skip listskip list
skip list
 
Doubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || AlgorithmsDoubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || Algorithms
 
Chap 3 c++
Chap 3 c++Chap 3 c++
Chap 3 c++
 

Similar to Macros for Shape and formula

ADV Powepoint 3 Lec.pptx
ADV Powepoint 3 Lec.pptxADV Powepoint 3 Lec.pptx
ADV Powepoint 3 Lec.pptxArjayBalberan1
 
Objectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdfObjectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdffcsondhiindia
 
Intro to tsql unit 10
Intro to tsql   unit 10Intro to tsql   unit 10
Intro to tsql unit 10Syed Asrarali
 
Algorithms devised for a google interview
Algorithms devised for a google interviewAlgorithms devised for a google interview
Algorithms devised for a google interviewRussell Childs
 
ScalaLanguage_ch_4_5.pptx
ScalaLanguage_ch_4_5.pptxScalaLanguage_ch_4_5.pptx
ScalaLanguage_ch_4_5.pptxjkapardhi
 
hello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docxhello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docxIsaac9LjWelchq
 
Oracle_Analytical_function.pdf
Oracle_Analytical_function.pdfOracle_Analytical_function.pdf
Oracle_Analytical_function.pdfKalyankumarVenkat1
 
Introduction to oracle functions
Introduction to oracle functionsIntroduction to oracle functions
Introduction to oracle functionsNitesh Singh
 
two dimensional array
two dimensional array two dimensional array
two dimensional array Tariq Aziz
 

Similar to Macros for Shape and formula (20)

ADV Powepoint 3 Lec.pptx
ADV Powepoint 3 Lec.pptxADV Powepoint 3 Lec.pptx
ADV Powepoint 3 Lec.pptx
 
Objectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdfObjectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdf
 
Intro to tsql unit 10
Intro to tsql   unit 10Intro to tsql   unit 10
Intro to tsql unit 10
 
Variables
VariablesVariables
Variables
 
vbscripting
vbscriptingvbscripting
vbscripting
 
Algorithms devised for a google interview
Algorithms devised for a google interviewAlgorithms devised for a google interview
Algorithms devised for a google interview
 
SQL report
SQL reportSQL report
SQL report
 
Mysql1
Mysql1Mysql1
Mysql1
 
Introduction to Oracle Functions--(SQL)--Abhishek Sharma
Introduction to Oracle Functions--(SQL)--Abhishek SharmaIntroduction to Oracle Functions--(SQL)--Abhishek Sharma
Introduction to Oracle Functions--(SQL)--Abhishek Sharma
 
ScalaLanguage_ch_4_5.pptx
ScalaLanguage_ch_4_5.pptxScalaLanguage_ch_4_5.pptx
ScalaLanguage_ch_4_5.pptx
 
Cursors
CursorsCursors
Cursors
 
MA3696 Lecture 9
MA3696 Lecture 9MA3696 Lecture 9
MA3696 Lecture 9
 
hello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docxhello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docx
 
Oracle_Analytical_function.pdf
Oracle_Analytical_function.pdfOracle_Analytical_function.pdf
Oracle_Analytical_function.pdf
 
Chapter 08
Chapter 08Chapter 08
Chapter 08
 
5. string
5. string5. string
5. string
 
Pandas csv
Pandas csvPandas csv
Pandas csv
 
Introduction to DAX Language
Introduction to DAX LanguageIntroduction to DAX Language
Introduction to DAX Language
 
Introduction to oracle functions
Introduction to oracle functionsIntroduction to oracle functions
Introduction to oracle functions
 
two dimensional array
two dimensional array two dimensional array
two dimensional array
 

More from Pramodkumar Jha

Macros for Border, Weight Clear Data
Macros for Border, Weight Clear DataMacros for Border, Weight Clear Data
Macros for Border, Weight Clear DataPramodkumar Jha
 
Macros code Copy paste visible data after filtering
Macros code Copy paste visible data after filteringMacros code Copy paste visible data after filtering
Macros code Copy paste visible data after filteringPramodkumar Jha
 
Macros code for Font, Style, Size, Bold
Macros code for Font, Style, Size, BoldMacros code for Font, Style, Size, Bold
Macros code for Font, Style, Size, BoldPramodkumar Jha
 
Macros code for Protecting and Unprotecting Sheets
Macros code for Protecting and Unprotecting SheetsMacros code for Protecting and Unprotecting Sheets
Macros code for Protecting and Unprotecting SheetsPramodkumar Jha
 
Non-Verbal communication language
Non-Verbal communication languageNon-Verbal communication language
Non-Verbal communication languagePramodkumar Jha
 
Communication across cultures
Communication across culturesCommunication across cultures
Communication across culturesPramodkumar Jha
 
Barriers to communication
Barriers to communicationBarriers to communication
Barriers to communicationPramodkumar Jha
 
Financial ratios analysis
Financial ratios analysisFinancial ratios analysis
Financial ratios analysisPramodkumar Jha
 
Financial concept (part ii)
Financial concept (part ii)Financial concept (part ii)
Financial concept (part ii)Pramodkumar Jha
 

More from Pramodkumar Jha (20)

R programming
R programmingR programming
R programming
 
Macros for Border, Weight Clear Data
Macros for Border, Weight Clear DataMacros for Border, Weight Clear Data
Macros for Border, Weight Clear Data
 
Macros code Copy paste visible data after filtering
Macros code Copy paste visible data after filteringMacros code Copy paste visible data after filtering
Macros code Copy paste visible data after filtering
 
Macros code For Loop
Macros code For LoopMacros code For Loop
Macros code For Loop
 
Macros code for Font, Style, Size, Bold
Macros code for Font, Style, Size, BoldMacros code for Font, Style, Size, Bold
Macros code for Font, Style, Size, Bold
 
Macros code for Protecting and Unprotecting Sheets
Macros code for Protecting and Unprotecting SheetsMacros code for Protecting and Unprotecting Sheets
Macros code for Protecting and Unprotecting Sheets
 
Macros for Workbook
Macros for WorkbookMacros for Workbook
Macros for Workbook
 
Macros for Workbook
Macros for WorkbookMacros for Workbook
Macros for Workbook
 
Macros to Copy Paste
Macros to Copy PasteMacros to Copy Paste
Macros to Copy Paste
 
Non-Verbal communication language
Non-Verbal communication languageNon-Verbal communication language
Non-Verbal communication language
 
Letters presentation
Letters presentationLetters presentation
Letters presentation
 
E mails presentation
E mails presentationE mails presentation
E mails presentation
 
Communication
CommunicationCommunication
Communication
 
Communication across cultures
Communication across culturesCommunication across cultures
Communication across cultures
 
Body language
Body languageBody language
Body language
 
Barriers to communication
Barriers to communicationBarriers to communication
Barriers to communication
 
Business intelligence
Business intelligenceBusiness intelligence
Business intelligence
 
Iifl
IiflIifl
Iifl
 
Financial ratios analysis
Financial ratios analysisFinancial ratios analysis
Financial ratios analysis
 
Financial concept (part ii)
Financial concept (part ii)Financial concept (part ii)
Financial concept (part ii)
 

Recently uploaded

BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...amitlee9823
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 

Recently uploaded (20)

BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 

Macros for Shape and formula

  • 2. Sub Rectangle_Shape() ' Code to insert shape ActiveSheet.Shapes.AddShape msoShapeRectangle, 0, 0, 200, 200 End Sub INSERT RECTANGLE THANK YOU
  • 4. Sub concatenate() ‘Applying Concatenate formula by using “range” Range("a3").Value = Range("a1") & " " & Range("a2").Value End Sub CODE CONCATENATE THANK YOU Sub concatenate () ‘Applying Concatenate formula by using “Cells” Cells(3, 1).Value = Cells(1, 1) & " " & Cells(2, 1).Value End Sub OR
  • 6. Dynamic Vlookup include 3 step: 1) Identifying Last Visible Cell till which Vlookup formula will run 2) Identifying the table range for Vlookup 3) Loop code to execute “Vlookup” formula till last visible cell CODE FOR DYNAMIC VLOOKUP NEXT: CODE FOR LAST VISIBLE CELL
  • 7. 1: COUNT CELL • It important to find count visible row cell so that when programme runs “Vlookup Formula” it may known were to stop. • Vlookup helps to find the value from Other workbook/sheets or from same sheet with the help of unique reference and therefore reference is important incase of it absence there will be an error. • If we not find the last cell till which “Vlookup formula” should run, then it may continue to run through out the sheet till the last cell of the sheet. NEXT: COUNT VISIBLE ROW CELL
  • 8. Sub Count_Visible_row() 'This code help to find only last visible row by counting all visible cell. But it do not count last visible column Dim Count_cell As Integer Dim Row_Range As String Sheet1.Select Count_cell = WorksheetFunction.CountA(Range("A:A")) End Sub COUNT VISIBLE ROW CELL NEXT: CODE FOR LAST VISIBLE ROW CELL & RANGE
  • 9. 2: TABLE_ARRAY OR TABLE RANGE • Table Array or a Range from which value is to be looked should be dynamic means, Range should include any new row/column or exclude any newly deleted row/column automatically. • To do that we need run a code before executing Vlookup formula, which help to find the last Row Cell & Last Column Cell. • Finding of Last Row & Column will helps to formulate a Table Array or Range from which value is to be looked. NEXT: CODE FOR LAST VISIBLE BOTH ROW & COLUMN
  • 10. Sub last_Visible_row() ' This code help to find only last visible row by counting all visible cell. But it do not count last visible column Dim Lastcell As String Dim Row_Range As String Lastcell = Range("a1").End(xlDown).Address MsgBox (Lastcell) Row_Range = Range("A1:" & Lastcell).Address MsgBox (Row_Range) End Sub CODE FOR LAST VISIBLE ROW CELL & RANGE NEXT: CODE FOR LAST VISIBLE COLUMN CELL & RANGE Code helps to find the address of last cell in Row Code helps to find the row’s range address
  • 11. Sub last_Visible_column() ' This code help to find only last visible row by counting all visible cell. But it do not count last visible column Dim Lastcell As String Dim Column_Range As String Lastcell = Range("a1").End(xlToRight).Address MsgBox (Lastcell) Column_Range = Range("A1:" & Lastcell).Address MsgBox (Column_Range) End Sub CODE FOR LAST VISIBLE COLUMN CELL & RANGE NEXT: CODE FOR LAST VISIBLE ROW CELL & RANGE Code helps to find the address of last cell in Column Code helps to find the column’s range address
  • 12. Sub last_Visible_Row_Column() 'This code help to find only last visible row by counting all visible cell. But it do not count last visible column Dim Lastcell_Row As String Dim Lastcell_Column As String Dim Table_Range As String Lastcell_Row = Range("a1").End(xlDown).Address Lastcell_Column = Range("a1").End(xlToRight).Address Table_Range = Range(Lastcell_Row & ":" & Lastcell_Column).Address MsgBox (Table_Range) End Sub NEXT: CODE FOR LAST VISIBLE BOTH ROW & COLUMN NEXT: CODE FOR LAST VISIBLE BOTH ROW & COLUMN
  • 13. 3: LOOP FOR VLOOKUP • Loop is use to perform same repetitive work. • Loop can be customized by providing condition to it. • Inserting Vlookup formula in each cell of row is an continuous process. And therefore to perform such repetitive work Loop are used NEXT: “FOR LOOP” FOR VLOOKUP
  • 14. Sub Loop_for_Vlookup() 'Count the number cell in which Vlookup need to performed which can be done through last cell visible code which we have done in previous slide. Dim count_Cell As Integer 'Insert Count Cell code to count no. of Visible Rows for Vlookup Dim Lastcell_Row As String 'Code to Identify last cell of row to form dynamic table array Dim Lastcell_Column As String 'Code to Identify last cell of column to form dynamic table array Dim Table_Range As String 'Code to combine result from Last cell Row and Last Cell Column Dim reference As String 'code for reference of cell for which valued are looked up For j = 1 To count_Cell reference = ("$A" & j) ActiveCell.Formula = "=VLOOKUP(" & reference & ",Sheet1!" & Table_Range & " ,2,0)" ActiveCell.Offset(1, 0).Select Next j End Sub “FOR LOOP” FOR VLOOKUP NEXT: DYNAMIC VLOOKUP
  • 15. DYNAMIC VLOOKUP Sub Dynamic_Vlookup() Dim count_Cell As Integer Dim reference As String Dim Lastcell_Row As String Dim Lastcell_Column As String Dim Table_Range As String Sheet2.Select count_Cell = WorksheetFunction.CountA(Range("A:A")) Sheet1.Select Lastcell_Row = Range("a1").End(xlDown).Address Lastcell_Column = Range("a1").End(xlToRight).Address Table_Range = Range(Lastcell_Row & ":" & Lastcell_Column).Address MsgBox (Table_Range) Sheet2.Select Range("B1").Select For j = 1 To count_Cell reference = ("$A" & j) ActiveCell.Formula = "=VLOOKUP(" & reference & ",Sheet1!" & Table_Range & " ,2,0)" ActiveCell.Offset(1, 0).Select Next j End Sub