Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在不考虑单元格 B2:B6 的情况下自动调整列 A:C(我希望这些单元格包含长字符串)。有没有办法告诉 excel 在自动拟合时忽略这些单元格?
谢谢,李
这可以满足您的需求。您还可以修改以自动调整选定的单元格:
Sub Fit_Column_to_Some_Cells() Dim rng As Excel.Range Set rng = ActiveSheet.Range("$A:$A,$C:$C,$B$1,$B$7:$B$1048576") rng.Columns.AutoFit End Sub
使用宏: