Worf

Draw the Ukrainian flag with VBA

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
4,261
Worf submitted a new Excel article:

Draw the Ukrainian flag with VBA - This article shows six different ways to draw a flag.


Read more about this Excel article...
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Here's another way:

VBA Code:
Sub DrawFlag()
    Dim Code(1 To 3) As String
    Dim Filename As String: Filename = Environ("TEMP") & "\flag.svg"
    Code(1) = "<svg width=""440"" height=""275"" xmlns=""http://www.w3.org/2000/svg"" xmlns:xlink=""http://www.w3.org/1999/xlink"" xml:space=""preserve"" overflow=""hidden"">"
    Code(2) = "<defs><clipPath id=""clip0""><rect x=""0"" y=""0"" width=""440"" height=""275""/></clipPath></defs>"
    Code(3) = "<g clip-path=""url(#clip0)""><rect x=""0"" y=""0"" width=""440"" height=""138"" fill=""#055AB4""/><rect x=""0"" y=""138"" width=""440"" height=""137"" fill=""#FAD205""/></g></svg>"
    CreateObject("Scripting.FileSystemObject").CreateTextFile(Filename, True).WriteLine Join(Code)
    Application.ActiveSheet.Shapes.AddPicture Filename:=Filename, LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=Application.ActiveCell.Left, Top:=Application.ActiveCell.Top, Width:=-1, Height:=-1
    Kill Filename
End Sub
 

Forum statistics

Threads
1,226,453
Messages
6,191,134
Members
453,642
Latest member
jefals

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top