Log in

View Full Version : [SOLVED:] I need custom table layout available in all Excel workbooks created by me



zelarra
04-18-2025, 07:45 AM
Hello.

I've created a custom layout for tables, which I have in the templates for sheets and workbooks, but it doesn't appear in the workbooks I've already created.

The mere thought of having to move all the workbooks I've already created to those templates gives me cold sweats.

Therefore, I wanted to know if there was a way to integrate them into the Excel spreadsheets I've already created.

I'm attaching screenshots in case it helps you better understand what I need.

https://www.mrexcel.com/board/attachments/1744964529259-png.124480/

https://www.mrexcel.com/board/attachments/1744964534808-png.124481/

Thanks.

Aussiebear
04-18-2025, 01:24 PM
Welcome VBAX zelarra. Maybe this could be an option... Create a sub similar to that below which must be stored in your "Personal Macro Workbook"


Private Sub Workbook_Open()
' Replace these lines with the code that applies your custom layout
' For example, you might adjust column widths, row heights,
' apply specific themes, zoom levels, window states, etc.
' Example: Set default zoom to 85% ActiveWindow.Zoom = 85
' Example: Adjust column A width Columns("A").ColumnWidth = 15
' Example: Ensure gridlines are visible
ActiveWindow.DisplayGridlines = True
' You can call another macro here that contains your more complex layout settings
' Call ApplyMyCustomLayout
End Sub

' Optional: A separate sub to hold more complex layout code

Sub ApplyMyCustomLayout()
' Your more detailed layout adjustments here
' End Sub


When you open any Excel workbook, including older ones, Excel automatically runs the Workbook_Open() macro in your PERSONAL.XLSB file. This will then execute the code you've written to apply your desired layout settings.

zelarra
04-18-2025, 03:08 PM
Thanks a lot, guys.


In the end, I have to sit down and generate all the code, because it seems I can't "capture" the design of the style I've already created.


Best regards.