convert VBA to vb.net or VB6

hiici

New Member
Joined
Jul 14, 2017
Messages
14
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
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
various vba commands exist ONLY in that app....Excel commands only work in Excel, Word commands only in Word.

.NET doesnt use these. .NET would load the App driver, and use their commands anyway.
So just use VBA.
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,924
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top