Dinesh Santhalingam

Dinesh Santhalingam

  • NA
  • 737
  • 358.9k

Add a Combo Box in a Excel cell Using VBA

May 8 2017 5:40 AM
  1. Set objGEXCELapp = GetObject(, "EXCEL.Application")  
  2.   
  3. If Err.Number <> 0 Then  
  4. Err.Clear  
  5. Set objGEXCELapp = CreateObject("EXCEL.Application")  
  6. End If  
  7. objGEXCELapp.Application.Visible = True  
  8. Set objGEXCELwkBks = objGEXCELapp.Application.Workbooks  
  9. Set objGEXCELwkBk = objGEXCELwkBks.Add  
  10. Set objGEXCELwkShs = objGEXCELwkBk.Worksheets(1)  
  11. Set objGEXCELSh = objGEXCELwkBk.Sheets(1)  
  12.   
  13.   
  14. objGEXCELSh.Cells(1, "A") = "Name"  
  15. objGEXCELSh.Cells(1, "B") = "Age"  
  16. objGEXCELSh.Cells(1, "C") = "Weight"  
  17. objGEXCELSh.Cells(1, "D") = "Height"  
  18. objGEXCELSh.Cells(1, "E") = "Sex"  
  19. objGEXCELSh.Cells(1, "F") = "Your Option"   
  20.   
  21. objGEXCELSh.Cells(i, "A") = Dhini  
  22. objGEXCELSh.Cells(i, "B") = 22  
  23. objGEXCELSh.Cells(i, "C") = 73  
  24. objGEXCELSh.Cells(i, "D") = 165  
  25. objGEXCELSh.Cells(i, "E") = Male  
  26.  objGEXCELSh.Cells(i, "F") = Here I need a Combobox to occupy in a cell to select   
I need a combobox in my cell .Please give me a solution.

Answers (1)