Sub MailMergeWithTwoImages()
Dim ppt As Presentation
Dim slide As slide
Dim excelApp As Object
Dim wb As Object
Dim ws As Object
Dim i As Integer
Dim nameText As String
Dim imagePath1 As String
Dim imagePath2 As String
Dim shape As shape
Dim imgShape1 As shape
Dim imgShape2 As shape
Dim originalSlide As slide
Dim newSlide As slide
Dim imagePlaceholder1 As shape
Dim imagePlaceholder2 As shape
' Initialize Excel Application and Workbook
Set excelApp = CreateObject("Excel.Application")
Set wb = excelApp.Workbooks.Open("D:\AUTOMATION\ExcelFile.xlsx")
Set ws = wb.Sheets(1)
' Get the active PowerPoint presentation
Set ppt = ActivePresentation
' Ensure there's at least one slide in the presentation
If ppt.Slides.Count > 0 Then
Set originalSlide = ppt.Slides(1)
i = 2
Do While ws.Cells(i, 1).Value <> ""
' Get the name and image paths from the Excel sheet
nameText = ws.Cells(i, 1).Value
imagePath1 = ws.Cells(i, 2).Value
imagePath2 = ws.Cells(i, 3).Value ' Assuming column C holds the second image path
' Add a new slide and copy shapes from the original slide
Set newSlide = ppt.Slides.Add(ppt.Slides.Count + 1, ppLayoutText)
' Copy all shapes from original slide
For Each shape In originalSlide.Shapes
shape.Copy
newSlide.Shapes.Paste
Next shape
' Replace text placeholder (assuming title placeholder contains "[Title]")
For Each shape In newSlide.Shapes
If shape.HasTextFrame Then
If shape.TextFrame.TextRange.Text Like "*[Title]*" Then
shape.TextFrame.TextRange.Text = Replace(shape.TextFrame.TextRange.Text, "[Title]", nameText)
End If
End If
Next shape
' Find placeholders for two images
For Each shape In newSlide.Shapes
If shape.Name = "MyImage1" Then
Set imagePlaceholder1 = shape
ElseIf shape.Name = "MyImage2" Then
Set imagePlaceholder2 = shape
End If
Next shape
' Insert first image
If Dir(imagePath1) <> "" Then
If Not imagePlaceholder1 Is Nothing Then
Set imgShape1 = newSlide.Shapes.AddPicture(imagePath1, _
MsoTriState.msoFalse, MsoTriState.msoCTrue, _
imagePlaceholder1.Left, imagePlaceholder1.Top, _
imagePlaceholder1.Width, imagePlaceholder1.Height)
Else
MsgBox "First image placeholder not found.", vbExclamation, "Error"
End If
Else
MsgBox "First image not found: " & imagePath1, vbExclamation, "Error"
End If
' Insert second image
If Dir(imagePath2) <> "" Then
If Not imagePlaceholder2 Is Nothing Then
Set imgShape2 = newSlide.Shapes.AddPicture(imagePath2, _
MsoTriState.msoFalse, MsoTriState.msoCTrue, _
imagePlaceholder2.Left, imagePlaceholder2.Top, _
imagePlaceholder2.Width, imagePlaceholder2.Height)
Else
MsgBox "Second image placeholder not found.", vbExclamation, "Error"
End If
Else
MsgBox "Second image not found: " & imagePath2, vbExclamation, "Error"
End If
i = i + 1
Loop
Else
MsgBox "No slide to copy from. Please ensure the presentation has at least one slide.", vbCritical, "Error"
End If
' Clean up
wb.Close False
excelApp.Quit
Set excelApp = Nothing
End Sub
Author: Saravana Kumar
-
How to Automatically Insert Two Images into Microsoft PowerPoint Slides
-
100 famous quotes from leaders around the world:
100 famous quotes from leaders around the world:
- “Be the change that you wish to see in the world.” – Mahatma Gandhi
- “The best way to predict your future is to create it.” – Abraham Lincoln
- “I have a dream.” – Martin Luther King Jr.
- “Success is not final, failure is not fatal: It is the courage to continue that counts.” – Winston Churchill
- “The only thing we have to fear is fear itself.” – Franklin D. Roosevelt
- “In the end, we will remember not the words of our enemies, but the silence of our friends.” – Martin Luther King Jr.
- “It always seems impossible until it’s done.” – Nelson Mandela
- “A leader is one who knows the way, goes the way, and shows the way.” – John C. Maxwell
- “Don’t find fault, find a remedy.” – Henry Ford
- “Leadership and learning are indispensable to each other.” – John F. Kennedy
- “You must be the change you wish to see in the world.” – Mahatma Gandhi
- “The future belongs to those who believe in the beauty of their dreams.” – Eleanor Roosevelt
- “The greatest leader is not necessarily the one who does the greatest things. He is the one that gets people to do the greatest things.” – Ronald Reagan
- “Innovation distinguishes between a leader and a follower.” – Steve Jobs
- “If your actions inspire others to dream more, learn more, do more, and become more, you are a leader.” – John Quincy Adams
- “I am not a product of my circumstances. I am a product of my decisions.” – Stephen Covey
- “Leadership is the capacity to translate vision into reality.” – Warren Bennis
- “Do not follow where the path may lead. Go instead where there is no path and leave a trail.” – Ralph Waldo Emerson
- “The price of greatness is responsibility.” – Winston Churchill
- “To handle yourself, use your head; to handle others, use your heart.” – Eleanor Roosevelt
- “Victory belongs to the most persevering.” – Napoleon Bonaparte
- “Leadership is solving problems. The day soldiers stop bringing you their problems is the day you have stopped leading them.” – Colin Powell
- “Do what you can, with what you have, where you are.” – Theodore Roosevelt
- “A genuine leader is not a searcher for consensus but a molder of consensus.” – Martin Luther King Jr.
- “The function of leadership is to produce more leaders, not more followers.” – Ralph Nader
- “Perseverance is failing 19 times and succeeding the 20th.” – Julie Andrews
- “As we look ahead into the next century, leaders will be those who empower others.” – Bill Gates
- “The key to successful leadership today is influence, not authority.” – Ken Blanchard
- “You don’t lead by hitting people over the head – that’s assault, not leadership.” – Dwight D. Eisenhower
- “I suppose leadership at one time meant muscles; but today it means getting along with people.” – Mahatma Gandhi
- “The art of leadership is saying no, not yes. It is very easy to say yes.” – Tony Blair
- “A good leader takes a little more than his share of the blame, a little less than his share of the credit.” – Arnold H. Glasow
- “He who has never learned to obey cannot be a good commander.” – Aristotle
- “Leadership is not about titles, positions, or flowcharts. It is about one life influencing another.” – John C. Maxwell
- “A man who wants to lead the orchestra must turn his back on the crowd.” – Max Lucado
- “He who cannot be a good follower cannot be a good leader.” – Aristotle
- “The leader has to be practical and a realist yet must talk the language of the visionary and the idealist.” – Eric Hoffer
- “Management is doing things right; leadership is doing the right things.” – Peter Drucker
- “If you think you can do a thing or think you can’t do a thing, you’re right.” – Henry Ford
- “The ear of the leader must ring with the voices of the people.” – Woodrow Wilson
- “I learned that courage was not the absence of fear, but the triumph over it.” – Nelson Mandela
- “The strength of the team is each individual member. The strength of each member is the team.” – Phil Jackson
- “Do not go where the path may lead, go instead where there is no path and leave a trail.” – Ralph Waldo Emerson
- “One person with courage is a majority.” – Thomas Jefferson
- “Lead, follow, or get out of the way.” – Thomas Paine
- “Leadership is not about being in charge. It is about taking care of those in your charge.” – Simon Sinek
- “When the best leader’s work is done, the people say, ‘We did it ourselves.’” – Lao Tzu
- “The highest form of leadership is self-leadership.” – Robin Sharma
- “To add value to others, one must first value others.” – John C. Maxwell
- “A leader is best when people barely know he exists, when his work is done, they will say: we did it ourselves.” – Lao Tzu
- “Leadership is an action, not a position.” – Donald McGannon
- “Earn your leadership every day.” – Michael Jordan
- “The challenge of leadership is to be strong, but not rude; be kind, but not weak; be bold, but not a bully; be humble, but not timid; be proud, but not arrogant; have humor, but without folly.” – Jim Rohn
- “True leadership lies in guiding others to success. In ensuring that everyone is performing at their best, doing the work they are pledged to do, and doing it well.” – Bill Owens
- “He who has learned how to obey will know how to command.” – Solon
- “A true leader has the confidence to stand alone, the courage to make tough decisions, and the compassion to listen to the needs of others.” – Douglas MacArthur
- “The greatest leaders mobilize others by coalescing people around a shared vision.” – Ken Blanchard
- “The supreme quality for leadership is unquestionable integrity.” – Dwight D. Eisenhower
- “Leadership is the art of giving people a platform for spreading ideas that work.” – Seth Godin
- “A leader is one who knows the way, goes the way, and shows the way.” – John C. Maxwell
- “Leadership is not about titles, positions, or flowcharts. It is about one life influencing another.” – John C. Maxwell
- “A person who never made a mistake never tried anything new.” – Albert Einstein
- “Leadership is the ability to guide others without force into a direction or decision that leaves them still feeling empowered and accomplished.” – Lisa Cash Hanson
- “To lead people, walk beside them. As for the best leaders, the people do not notice their existence.” – Lao Tzu
- “In matters of style, swim with the current; in matters of principle, stand like a rock.” – Thomas Jefferson
- “Before you are a leader, success is all about growing yourself. When you become a leader, success is all about growing others.” – Jack Welch
- “Effective leadership is not about making speeches or being liked; leadership is defined by results, not attributes.” – Peter Drucker
- “The function of leadership is to produce more leaders, not more followers.” – Ralph Nader
- “The growth and development of people is the highest calling of leadership.” – Harvey S. Firestone
- “Great leaders are not defined by the absence of weakness, but rather by the presence of clear strengths.” – John Zenger
- “The very essence of leadership is that you have to have a vision.” – Theodore M. Hesburgh
- “A true leader is not measured by how many followers he has, but by how many leaders he creates.” – Mahatma Gandhi
- “The quality of a leader is reflected in the standards they set for themselves.” – Ray Kroc
- “Leaders don’t inflict pain, they share pain.” – Max De Pree
- “Leadership is the capacity to translate vision into reality.” – Warren Bennis
- “You manage things; you lead people.” – Grace Hopper
- “No man will make a great leader who wants to do it all himself or get all the credit for doing it.” – Andrew Carnegie
- “The first responsibility of a leader is to define reality. The last is to say thank you. In between, the leader is a servant.” – Max De Pree
- “Courage is what it takes to stand up and speak; courage is also what it takes to sit down and listen.” – Winston Churchill
- “Example is leadership.” – Albert Schweitzer
- “A leader takes people where they want to go. A great leader takes people where they don’t necessarily want to go but ought to be.” – Rosalynn Carter
- “Leaders think and talk about the solutions. Followers think and talk about the problems.” – Brian Tracy
- “Leaders must be close enough to relate to others, but far enough ahead to motivate them.” – John C. Maxwell
- “The greatest leader is not necessarily the one who does the greatest things. He is the one that gets the people to do the greatest things.” – Ronald Reagan
- “The function of leadership is to produce more leaders, not more followers.” – Ralph Nader
- “Leadership is unlocking people’s potential to become better.” – Bill Bradley
- “The single biggest way to impact an organization is to focus on leadership development. There is almost no limit to the potential of an organization that recruits good people, raises them up as leaders, and continually develops them.” – John Maxwell
- “In the past, a leader was a boss. Today’s leaders must be partners with their people… they no longer can lead solely based on positional power.” – Ken Blanchard
- “Leadership is not about the next election, it’s about the next generation.” – Simon Sinek
- “True leadership lies in guiding others to success—in ensuring that everyone is performing at their best, doing the work they are pledged to do, and doing it well.” – Bill Owens
- “A great leader’s courage to fulfill his vision comes from passion, not position.” – John Maxwell
- “Leadership is not just about giving energy…it’s unleashing other people’s energy.” – Paul Polman
- “A real leader faces the music, even when he doesn’t like the tune.” – Arnold H. Glasow
- “Leadership is not a person or a position. It is a complex moral relationship between people based on trust, obligation, commitment, emotion, and a shared vision of the good.” – Joanne Ciulla
- “The most dangerous leadership myth is that leaders are born—that there is a genetic factor to leadership. This myth asserts that people simply either have certain charismatic qualities or not. That’s nonsense; in fact, the opposite is true. Leaders are made rather than born.” – Warren G. Bennis
- “Leaders aren’t born, they are made. And they are made just like anything else, through hard work. And that’s the price we’ll have to pay to achieve that goal, or any goal.” – Vince Lombardi
- “People buy into the leader before they buy into the vision.” – John Maxwell
- “The function of leadership is to produce more leaders, not more followers.” – Ralph Nader
- “If you can dream it, you can do it.” – Walt Disney
- “The task of the leader is to get their people from where they are to where they have not been.” – Henry Kissinger
These quotes reflect the wisdom and insight of some of the world’s most influential leaders in history.
-
Tamil Motivation 100 Quotes
- முயற்சி தோல்வியை வெல்லும் ஆயுதம்.
- நம்பிக்கை வாழ்வின் முதன்மை தந்தை.
- தோல்வி தான் வெற்றியின் முதல் படி.
- முயன்றால் முடியாதது எதுவும் இல்லை.
- உழைத்தால் மட்டுமே வாழ்வில் வெற்றி கிடைக்கும்.
- நிமிர்ந்தே நீ வாழ், விழுந்தாலும் எழு.
- சிக்கல்களை சமாளித்தால் வெற்றி உன்னை வந்து சேரும்.
- உழைப்பு தான் வாழ்க்கையை உயரத்துக்கு எடுத்துச் செல்லும்.
- சவால்களை எதிர்கொள், வெற்றி உன் பக்கம்.
- வலிமை உள்ளவன் தோல்வியை ஏற்க மாட்டான்.
- விடாமுயற்சியே வாழ்வின் வெற்றியின் க Schlüssel.
- உன் கனவுகளை விட்டு விடாதே.
- தைரியம் கொண்டால் தான் முன்னேற்றம் உண்டு.
- எதையும் வெல்லும் உழைப்பே அழிவில்லாத வெற்றி.
- காலம் புறமாக இருந்தால் கூட முயற்சியை விடாதே.
- நம்பிக்கை இருக்கும்போது வாழ்வு இனிமையாக இருக்கும்.
- முயற்சிக்கு விடாமுயற்சிதான் ஒற்றை முத்திரை.
- தன்னம்பிக்கை நீ இருக்கும் வரை வாழ்வில் தோல்வி கிடையாது.
- எதிர்காலம் உன் கையில், உழைத்தால் கிடைக்கும்.
- முயன்றால் ஒருநாள் வெற்றி உனக்கு கிடைக்கும்.
- கடின உழைப்பை விட சிறந்த வழி இல்லை.
- வாழ்வின் எல்லை உன் எண்ணங்கள் மட்டுமே.
- வெற்றியாளன் சவால்களை எதிர்த்து வாழ்பவன்.
- விடாமுயற்சியே உலகில் அனைத்திற்கும் பதில்.
- பயம் வெற்றியை தடுக்காது, முயற்சி தடுக்கும்.
- கனவுகளுக்கு இடம் கொடுக்கும் வரை தோல்வியில்லை.
- உன் செயல்கள் உன்னை உயரத்துக்கு கொண்டு செல்லும்.
- சவால்களை சமாளித்தால் வெற்றி உனதாக்கலாம்.
- அன்புடன் செயலில் இறங்கினால் வெற்றி உறுதி.
- உழைப்புக்கான பதில் வெற்றி தான்.
- உன்னால் முடியும் என்று நினைத்தால் முடியும்.
- விடாமுயற்சிக்கு எல்லாம் சாத்தியம்.
- நாளை புதிதாக தொடங்க இன்னும் இன்று முடியும்.
- காலம் உன் பக்கம் வர, உழைப்பு சாவியாகும்.
- முயற்சிக்கு ஏற்ற பதிலாக வரும் வெற்றி இனிமையானது.
- உன் கனவுகளை அடைவதற்கு உனது தைரியம் மட்டும் போதும்.
- விடாமுயற்சி தோல்வியை வெல்லும் ஆயுதம்.
- முயற்சிக்கு எல்லையில்லை.
- நம்பிக்கை இல்லாமல் எந்த முயற்சியும் சாதிக்காது.
- நிம்மதியை தேடும் பயணம் உழைப்பில் உள்ளது.
- உன் வெற்றியை நீ நிச்சயமாக உருவாக்க முடியும்.
- உழைத்தால் வாழ்வில் வெற்றி உறுதி.
- நம்பிக்கையும் முயற்சியும் ஒரே பக்கம் கொண்ட நாணயம்.
- முயற்சி செய்வது வாழ்க்கையின் அடிப்படை.
- உன்னை நம்பு, உலகம் உன் பக்கம் வரும்.
- எதையும் முயன்று வெல்ல முடியும்.
- உழைத்தால் வாழ்வில் தோல்வியில்லை.
- விடாமல் முயன்று வெற்றியை அடையலாம்.
- உன் கனவுகளை உடைக்காதே, உன் முயற்சியை விடாதே.
- கடின உழைப்புக்கான பதில் வெற்றி.
- முயற்சி செய்பவன் எப்போதும் தோல்வியடைய மாட்டான்.
- உன் கனவுகளை எப்போதும் விட்டு விடாதே.
- வெற்றியை அடைய விரும்பினால் முயற்சியை தொடங்கு.
- உழைத்தால் மட்டுமே உயரத்துக்கு சென்று முடியலாம்.
- உன்னால் முடியும் என்ற நம்பிக்கை எல்லாவற்றுக்கும் முக்கியம்.
- வெற்றி என்பது உனது கடின உழைப்பின் முடிவு.
- சிக்கல்களை வென்றாலே வெற்றியாளன்.
- உழைப்பு வெற்றியின் இரகசியம்.
- கனவுகள் சாதனை செய்வதற்கான வழிகாட்டிகள்.
- முயற்சியே வாழ்வின் அடித்தளம்.
- கனவுகளின் நம்பிக்கை உன் வாழ்வின் காட்சி.
- கடின உழைப்பால் வெற்றி நிச்சயம்.
- உழைப்பின் வெற்றி இனிமையாக இருக்கும்.
- வெற்றியை அடைய முயற்சி செய், வெற்றி உனது.
- முயன்றால் வாழ்க்கையில் சாதிக்கலாம்.
- முயற்சி செய்தால் வெற்றி தானாகவே வரும்.
- உறுதியான நம்பிக்கையுடன் முன்னேறு.
- வெற்றியை நோக்கி உழைப்பை துவங்கு.
- உன்னால் முடியும் என்ற நம்பிக்கையை விட்டு விடாதே.
- முயற்சியில் தாழ்வு இல்லை.
- நாளை வெற்றி பெற முயற்சியை இன்று துவங்கு.
- சிக்கல்களை சமாளித்து முன்னேறு.
- வெற்றிக்கு முன் தோல்வியில்லை.
- உன்னுடைய முயற்சி உன் வெற்றியை தீர்மானிக்கின்றது.
- முயற்சிக்கு எல்லையில்லை, வெற்றிக்கு முடிவில்லை.
- உன்னுடைய முயற்சி உன்னை உயர்த்தும்.
- தைரியமாக முயற்சியை துவங்கு.
- சவால்களை வென்றால் வெற்றி உனது.
- உழைப்பில் தான் வெற்றி அடையலாம்.
- நம்பிக்கையை வளர்த்து முன்னேறு.
- உன் கனவுகளை அடைய, முயற்சியை துவங்கு.
- சிக்கல்களை வென்றால் வாழ்வில் வெற்றி நிச்சயம்.
- வாழ்வின் வெற்றி உன் முயற்சியில் இருக்கிறது.
- உன்னுடைய முயற்சி உன் எதிர்காலத்தை தீர்மானிக்கிறது.
- உழைத்தால் வெற்றி கண்டிப்பாக கிடைக்கும்.
- முயற்சியின்றி எந்த வெற்றியும் சாத்தியமில்லை.
- சவால்களை சமாளித்து வெற்றியை அடை.
- விடாமுயற்சியே வெற்றியின் ரகசியம்.
- வெற்றி காண உழைப்பே முக்கியம்.
- முயற்சியை செய்ய முயற்சி செய்.
- முயன்றால் வெற்றி உனக்கு நிச்சயம்.
- சவால்கள் முன்னேற்றத்திற்கு வழி காட்டும்.
- முயற்சி செய்தால், வெற்றியாளன் நீயே.
- உழைப்பின் பலன் வெற்றி.
- தன்னம்பிக்கையும் முயற்சியும் வெற்றியின் படிகள்.
- உன்னுடைய முயற்சி உனக்கு வெற்றியை தரும்.
- முயற்சியில் எப்போதும் தோல்வி இல்லை.
- வெற்றியின் உச்சி உனது முயற்சியில் இருக்கிறது.
- முயற்சியில் உன் வாழ்வின் வெற்றி உள்ளது.
- உழைத்தால் வாழ்வில் வெற்றி நிச்சயம்.
-
Microsoft Excelஇல் COUNTIF, COUNTIFS பயன்படுத்துவது எப்படி?
COUNTIF Function:
The COUNTIF function counts the number of cells in a range that meet a single condition.
Syntax:
=COUNTIF(range, criteria)
- range: The range of cells to count.
- criteria: The condition to meet.
Example:
If you want to count how many students scored more than 50 in a list:
=COUNTIF(B2:B10, ">50")
This will count the number of cells in the range B2where the value is greater than 50.
COUNTIFS Function:
The COUNTIFS function counts the number of cells that meet multiple conditions.
Syntax:
=COUNTIFS(range1, criteria1, range2, criteria2, ...)
- range1: The first range to evaluate.
- criteria1: The first condition.
- range2: The second range to evaluate.
- criteria2: The second condition.
Example:
If you want to count how many students scored more than 50 and also have a status of “Pass”:
=COUNTIFS(B2:B10, ">50", C2:C10, "Pass")
This will count the number of cells in B2with values greater than 50 and in C2with the status “Pass”.
Key Points:
- COUNTIF is used for a single condition.
- COUNTIFS is used for multiple conditions.
- When specifying conditions, use appropriate comparison operators like
>
,<
,=
.
These functions are useful for filtering and counting data based on conditions in Excel.
-
Mail Merge in Powerpoint – Single Image Each Slide automatically
Sub MailMergeWithImages() Dim ppt As Presentation Dim slide As slide Dim excelApp As Object Dim wb As Object Dim ws As Object Dim i As Integer Dim nameText As String Dim imagePath As String Dim shape As shape Dim imgShape As shape Dim originalSlide As slide Dim newSlide As slide Dim imagePlaceholder As shape Set excelApp = CreateObject("Excel.Application") Set wb = excelApp.Workbooks.Open("D:\AUTOMATION\ExcelFile.xlsx") Set ws = wb.Sheets(1) Set ppt = ActivePresentation If ppt.Slides.Count > 0 Then Set originalSlide = ppt.Slides(1) i = 2 Do While ws.Cells(i, 1).Value <> "" nameText = ws.Cells(i, 1).Value imagePath = ws.Cells(i, 2).Value Set newSlide = ppt.Slides.Add(ppt.Slides.Count + 1, ppLayoutText) For Each shape In originalSlide.Shapes shape.Copy newSlide.Shapes.Paste Next shape For Each shape In newSlide.Shapes If shape.HasTextFrame Then If shape.TextFrame.TextRange.Text Like "*[Title]*" Then shape.TextFrame.TextRange.Text = Replace(shape.TextFrame.TextRange.Text, "[Title]", nameText) End If End If Next shape For Each shape In newSlide.Shapes If shape.Name = "MyImages" Then Set imagePlaceholder = shape Exit For End If Next shape If Dir(imagePath) <> "" Then If Not imagePlaceholder Is Nothing Then Set imgShape = newSlide.Shapes.AddPicture(imagePath, _ MsoTriState.msoFalse, MsoTriState.msoCTrue, _ imagePlaceholder.Left, imagePlaceholder.Top, _ imagePlaceholder.Width, imagePlaceholder.Height) Else MsgBox "Image placeholder not found.", vbExclamation, "Error" End If Else MsgBox "Image not found: " & imagePath, vbExclamation, "Error" End If i = i + 1 Loop Else MsgBox "No slide to copy from. Please ensure the presentation has at least one slide.", vbCritical, "Error" End If wb.Close False excelApp.Quit Set excelApp = Nothing End Sub