I have on sheet 2 the following scenario;
Columns C:AF are merged from rows 17:49. These referred rows gets data from sheet 1 through single columns in rows 17:49. I have difficulty to auto fit the data on sheet 2 if the data overflows the merged columns width. I have tried the following code with no success, the data doesn’t auto fit in the merged cells.
Private Sub Worksheet_Activate()
ActiveSheet.Unprotect
Application.ScreenUpdating = False
Rows("17:49").EntireRow.AutoFit
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells
Application.ScreenUpdating = True
End Sub
Pls give me some direction.
Columns C:AF are merged from rows 17:49. These referred rows gets data from sheet 1 through single columns in rows 17:49. I have difficulty to auto fit the data on sheet 2 if the data overflows the merged columns width. I have tried the following code with no success, the data doesn’t auto fit in the merged cells.
Private Sub Worksheet_Activate()
ActiveSheet.Unprotect
Application.ScreenUpdating = False
Rows("17:49").EntireRow.AutoFit
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells
Application.ScreenUpdating = True
End Sub
Pls give me some direction.