Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I autofit a column that has merged cells?
  2. Worksheet xlSheet  
  3.  
  4. xlSheet.Cells[2, 1] = "Autobiographies and Titles, Autobiographies and Titles, Autobiographies  
  5. and Titles, Autobiographies and Titles, Autobiographies and Titles, Autobiographies and Titles,  
  6. Autobiographies and Titles, Autobiographies and Titles";  
  7.  
  8. Range hRangeSubsystemName = xlSheet.get_Range("A2", "G2");  
  9. hRangeSubsystemName.MergeCells = true;  
  10. hRangeSubsystemName.EntireColumn.AutoFit();