Posts

Showing posts from August, 2019

MS word drop down control with Excel data

Image
There are lots of things you can do with MS Excel and MS word. Word and Excel can be connected easily to build sophisticated use cases. Mail merge is one of the great tool, where you can leverage the data power of excel and reporting feature of the MS Word. With a bit of VBA knowledge, you can extend the mail merge for usages. Below I explain how to use the Excel data to populate the DropDown control in the MS word. And it is dynamic, when the data in Excel got changed, the items in the drop-down will also be changed.  First, I have this sample data in Excel. I want this data to be displayed in a dropdown control in the MS Word. For this I am making use of this macro or VBA code. Private Sub ld_Click() Dim objExcel As New Excel.Application Dim objWB As Excel.Workbook Set objWB = objExcel.Workbooks.Open("C:\Users\krsanjee\Documents\krishtalk.com\book1.xlsx") 'Me.drop.RemoveItem (0) Me.drop.Clear total_rows = Cells(Rows.Count, 1).End(xlUp)....