Show Country Flags as Markers on X Y Chart
If you want to display the country flags as markers on X Y Scatter Chart. Snapshot below:
Steps
1 Download the country flags and save them in a folder
2 Make sure you name the flags as labels or series name
3 Run below macro
Sub custom_markers()
Dim srs As Series
Dim cht As Chart
Dim mapfolder As String
' make sure you save the maps with series name
mapfolder = "C:\Users\admin\Desktop\Flags\" ' folder in which i saved all the maps
' change chart name here
Set cht = Sheets("Sheet1").ChartObjects("Chart 1").Chart
' download the maps or shapes and save them in a folder
' I have downloaded maps from this site : http://www.free-country-flags.com/flag_pack.php?id=1
'run a loop to import flags to markes and display them on charts
For Each srs In cht.SeriesCollection
srs.MarkerStyle = xlMarkerStylePicture
srs.Format.Fill.UserPicture (mapfolder & srs.Name & ".png")
srs.Format.Line.Visible = msoFalse
srs.MarkerForegroundColorIndex = xlColorIndexNone
Next srs
End Sub
Download working File https://app.box.com/s/ulyhg0etinlsqlz88uyr
- Ashish Koul's blog
- Login or register to post comments
- 11006 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago