I have a simple module that calls a form to allow the user to select a row that sets a header filter and colors. I am trying to figure out how to convert this to vb.net or vb6 so it can be compiled.
All the documentation I found is from 2005 visual studio and it doesn't work in visual studio 2015. Any help appreciated , my module is shown below.
thx
mike
Sub HeaderFilter()
Dim hdr_row As Long
With ActiveWorkbook
If .ProtectWindows Or .ProtectStructure Then
response = MsgBox("This function requires access to your workbook. Please unprotect before proceeding")
End
End If
End With
If Worksheets(ActiveSheet.Name).ProtectContents = True Then
response = MsgBox("This function requires access to your workbook. Please unprotect before proceeding")
End
End If
'popup to determine row
With selected_header
.Show
hdr_row = .hdrrow.Value
End With
Unload selected_header
Rows(hdr_row & ":" & hdr_row).Select
With ActiveWindow
.SplitColumn = 0
.SplitRow = 1
End With
ActiveWindow.FreezePanes = True
Selection.AutoFilter
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
Cells.Select
Cells.EntireColumn.AutoFit
Rows(hdr_row & ":" & hdr_row).Select
Cells.Select
Selection.AutoFilter
Selection.AutoFilter
Range("A1").Select
End Sub
All the documentation I found is from 2005 visual studio and it doesn't work in visual studio 2015. Any help appreciated , my module is shown below.
thx
mike
Sub HeaderFilter()
Dim hdr_row As Long
With ActiveWorkbook
If .ProtectWindows Or .ProtectStructure Then
response = MsgBox("This function requires access to your workbook. Please unprotect before proceeding")
End
End If
End With
If Worksheets(ActiveSheet.Name).ProtectContents = True Then
response = MsgBox("This function requires access to your workbook. Please unprotect before proceeding")
End
End If
'popup to determine row
With selected_header
.Show
hdr_row = .hdrrow.Value
End With
Unload selected_header
Rows(hdr_row & ":" & hdr_row).Select
With ActiveWindow
.SplitColumn = 0
.SplitRow = 1
End With
ActiveWindow.FreezePanes = True
Selection.AutoFilter
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
Cells.Select
Cells.EntireColumn.AutoFit
Rows(hdr_row & ":" & hdr_row).Select
Cells.Select
Selection.AutoFilter
Selection.AutoFilter
Range("A1").Select
End Sub