Skip to content

December 2017

Working With Workbooks in Excel VBA

    Referring to a Workbook Using ThisWorkbook Dim wb As Workbook Set wb = ThisWorkbook wb.Close SaveChanges:=True Open a Workbook Workbooks.Open Filename:=”C:\Users\xxxx\Desktop\Finance.xlsx”, ReadOnly:=True Close (and Save Changes to) a Previously Saved Workbook Workbooks(“Finance.xlsx”).Close SaveChanges:=True Close (and Save Changes to) to a New Workbook ActiveWorkbook.Close savechanges:=True,Filename:=”C:\Users\xxxx\Desktop\Test.xlsx” Save Workbook ActiveWorkbook.Save Performing a SaveAs… ActiveWorkbook.SaveAs Filename:=”C:\Users\xxxx\Desktop\COPY_Test.xlsx” Delete Workbook Kill “C:\Users\xxxx\Desktop\COPY_Test.xlsm”… Read More »Working With Workbooks in Excel VBA

    Working With Worksheets in Excel VBA

      Select a Specific Worksheet Worksheets(“Expenditure 2016”).Select Refer to the Active Worksheet Using ActiveSheet ActiveSheet.Range(“A10”).Interior.ColorIndex = 7 Activate a Worksheet Worksheets(“Sheet1”).Activate Create a New Worksheet/s Worksheets.Add before:=Worksheets(“Sheet4”), Count:=5 Name a Worksheet Name the active sheet ActiveSheet.Name = “New Name” Name a specific sheet Worksheets(“Expenditure 2016 Draft”).Name = “Expenditure 2016 Final” Change a Worksheet’s Tab Colour Worksheets(“Sheet1”).Tab.ColorIndex… Read More »Working With Worksheets in Excel VBA

      Countdown to Christmas in Excel with Christmas Tree & Lights

        A few years’ ago I created a video showing you how to create an animated Christmas tree.  See the video here https://www.bluepecantraining.com/portfolio/created-a-christmas-tree-with-sparkling-lights-in-excel/ It’s Christmas time again and I thought it was time to create version 2.0 to include an automated countdown to Christmas and animated tree and stars, all on a Christmassy background.  Watch the… Read More »Countdown to Christmas in Excel with Christmas Tree & Lights