Some useful vba samples

It seems that recently I’ve been getting a lot of questions about vba.  To that end I thought it might be useful to post the link to this microsoft site which gives some examples of vba coding in the different office programs.  You can download them all as a zip file and use for training purposes or in your real work.

101 VBA samples for Office 2010


I found it useful just for the excel links alone:

  • Add Icon Sets for Ranges Using Excel.AddIconSetCondition
  • Apply Conditional Formatting Using the Excel.DataBar Method
  • Change Colors to Indicate Values Above and Below Average in Ranges
  • Communicate with PageSetup Using the Excel.PrintCommunication Method
  • Create and Manipulate Custom Views Using Excel.CustomView Method
  • Create Charts Events Programmatically
  • Determine Open Add-Ins Using Excel.TestAddIn.IsOpen
  • Display Top Ten Percent in Ranges Programmatically
  • Display Unique Numbers in Ranges Using Excel.AddUnique
  • Enable Removal of Duplicate Rows Using Excel.RemoveDuplicates
  • Export Data to PDF or XPS Using the Excel.ExportAsFixedFormat Method
  • Format Data Ranges Using the Excel.DisplayFormat Method
  • Formatting Colors in Ranges Using Excel.AddColorScale
  • Manipulate UI Properties Using Excel.ApplicationProperties
  • Modify Display Properties of Tables Using Excel.ListObjectDisplay
  • Remove Various Properties Using Excel.RemoveDocumentInformation
  • Retrieve Information About Chart Points Using Excel.PointClass
  • Show Properties of Chart Series Using Excel.SeriesProperties
  • Show Properties of Exceeded Frames Using Excel.TextFrameProperties
  • Show Properties of ListObject Using Excel.ListObjectTableStyles
  • Show Properties of the Window Object Using Excel.WindowProperties
  • Sort and Filter Programmatically Using Excel.ListObjectSortFilter
  • Sort Data Programmatically Using Excel.WorksheetSort
  • Use Properties of Sparkline Groups Using Excel.SparkLines
  • Work with DataBodyRange and Total Properties Using Excel.ListColumn
  • Work with Gradient Fill Features Using Excel.Gradient Method
  • Work with Header and Footer Properties Using Excel.PagesAndPage
  • Work with Hyperlinks Programmatically
  • Work with Several Date Functions Using Excel.WorksheetFunctionDates
  • Work with Various Properties Using Excel.PageSetup Object

Though I admit, I also liked the PowerPoint ones:

  • Add and Format Shapes Using PPT.ColorFormat.Brightness
  • Add Series of Application-Level Events Using PPT.NewEvents
  • Apply Themes & Backgrounds Using PPT.ApplyTheme.BackgroundStyle
  • Change Chart Locations Using PPT.InteractWithChartLocation
  • Control Animation Click Behavior Using PPT.SlideShowClicks
  • Convert Text into SmartArt Using PPT.ConvertTextToSmartArt
  • Copy Animation Using PPT.PickupAndApplyAnimation
  • Create Videos Programmatically
  • Display Media Control Properties
  • Export Slides as PPTX Files Using PPT.PublishSlides
  • Insert, Move, Get Section Counts Using PPT.WorkWithSections
  • Interact with Table Styles Using PPT.Table.ApplyStyle
  • Link Videos and Embedded Audio Files Using PPT.AddMedia
  • List SmartArt Names Using PPT.WorkWithSmartArt
  • Merge Two Decks into One Using PPT.MergeWithBaseline
  • Modify Aspects of Videos Using PPT.MediaFormatProperties
  • Resample and Reset Resolution Using PPT.ResampleMedia
  • Set Background Fill in Tables Using PPT.TableBackground
  • Set Banding and Scaling of Tables Using PPT.TableProperties
  • Use Custom XML Data Using PPT.CustomerDataDemo
  • View Properties of ShadowFormat Class Using PPT.Shadow
  • Work with FillFormat Texture Settings Using PPT.ShapeTexture
  • Work with Methods of Player Class Using PPT.WorkWithMediaPlayer
  • Work with Shape Glow and Reflection Properties

Hope the link and samples are useful for you!

Alesandra Blakeston

3 thoughts on “Some useful vba samples

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s