I've 4 different worksheet & different table. I trying to change the formatting using loop for all the worksheet but the range defined below is giving an error -
Method 'Range' of object '_Global' failed.
Data I have already in table form.
Dim WSHT As Worksheet
For Each WSHT In ActiveWorkbook.Worksheets
WSHT.Select
ActiveSheet.UsedRange.Select
Selection.RowHeight = 50
Selection.VerticalAlignment = xlCenter
Selection.WrapText = True
Selection.Font.Name = "GE Inspira Sans"
Selection.Font.Size = 9
Dim ALLTAB As ListObject
For Each ALLTAB In WSHT.ListObjects
Range("[[#All],[Customer Name]]").ColumnWidth = 20
Range("[[#All],[Customer Name]]").HorizontalAlignment = xlLeft
Next ALLTAB
Next WSHT
was using the below for formatting but I've 26 columns for update for each worksheet.
Range("OSD_TABLE_1[[#All],[Customer Name]]").ColumnWidth = 20
Range("OSD_TABLE_1[[#All],[Customer Name]]").HorizontalAlignment = xlLeft