Koszykowa
07-18-2019, 11:26 AM
Hello,
I have an excel file: columns A:G contain not very important data, but H:XXX contains the translated data. In each column from H to the end I have different language and country (e.g. de_DE or el_GR). I would like to write a code that is looking for in header a local that I want to have unhide and the rest (from H to XXX) will be hide. The data A:G stay untouched.
I wrote something but it does not work:
Sub Hajd()
Dim locale As String
locale = InputBox("Which column should not be hidden?", "Hide columns")
For i = 8 To 1000
If Cells(1, i).Value = locale Then
Cells(1, i).Column.Visible = True
Else
Cells(1, i).Column.Visible = False
End If
Next
End Sub
Could you please help me?
Many thanks
I have an excel file: columns A:G contain not very important data, but H:XXX contains the translated data. In each column from H to the end I have different language and country (e.g. de_DE or el_GR). I would like to write a code that is looking for in header a local that I want to have unhide and the rest (from H to XXX) will be hide. The data A:G stay untouched.
I wrote something but it does not work:
Sub Hajd()
Dim locale As String
locale = InputBox("Which column should not be hidden?", "Hide columns")
For i = 8 To 1000
If Cells(1, i).Value = locale Then
Cells(1, i).Column.Visible = True
Else
Cells(1, i).Column.Visible = False
End If
Next
End Sub
Could you please help me?
Many thanks