Nov 14 2023 06:51 AM
Hello,
I often have to export data from ministerial software and there are a lot of unnecessary columns. I cannot select the columns to export, the software only allows me to export all the columns. Is it possible to apply settings that allow me to automatically hide unnecessary columns?
THANKS
Nov 14 2023 08:00 AM
Here's another method using Excel's "Custom Views" feature:
This method allows you to easily switch between different column arrangements without using filtering or grouping. It's particularly useful when you have specific column configurations you frequently use.
Here some more couple of methods you can try:
vba code is untested, please backup your file first.
Sub HideColumns()
' Specify the columns you want to hide
Dim columnsToHide As String
columnsToHide = "C:D,F:H,J:Z"
' Split the column ranges
Dim colArray() As String
colArray = Split(columnsToHide, ",")
' Loop through the array and hide columns
Dim i As Integer
For i = LBound(colArray) To UBound(colArray)
Columns(colArray(i)).EntireColumn.Hidden = True
Next i
End Sub
Remember that using VBA requires some basic programming knowledge. Make sure to save your work before running any macro, and always test it on a copy of your data to avoid unintended consequences.
Choose the method that best fits your needs and comfort level with Excel features or VBA.
The text was created with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and like it!
This will help all forum participants.