Any ideas how to combine the 2 'Variant' variables into a single Variant or string. The row to look for below is:
SelectColumnsRows = DisplayColumns & DisplayRows
I get the error type mismatch, because of trying to use it with ws.Range(SelectColumnsRows).Select. Any help will be great. Thanks
Sub previewSub()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Call previewDisplayColumnRow(ws)
Next
MsgBox "Click on each Worksheets to preview columns/rows which will be displayed after clicking on 'UPDATE LAYOUT'"
End Sub
Sub previewDisplayColumnRow(ws As Worksheet)
Dim DisplayColumns As Variant
Dim DisplayRows As Variant
Dim HideColumnsRows As Variant
Dim SelectColumnsRows As String
Dim myrange
Set myrange = Worksheets("Control").Range("range_sheetProperties")
'Lookup Worksheet name and identify columns & rows to display
HideColumnsRows = Application.VLookup(ws.Name, myrange, 5, False)
DisplayColumns = Application.VLookup(ws.Name, myrange, 6, False)
DisplayRows = Application.VLookup(ws.Name, myrange, 7, False)
SelectColumnsRows = DisplayColumns & DisplayRows
'Preview Columns / Rows which will be hidden
If Not IsError(HideColumnsRows) Then
If HideColumnsRows = "Y" Then
'MsgBox ws.Name & " - " & SelectColumnsRows
ws.Activate
ws.Range(SelectColumnsRows).Select
End If
End If
End Sub