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
 

ranman256

Well-known Member
Joined
Jun 17, 2014
Messages
1,808
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.
 

Forum statistics

Threads
1,082,305
Messages
5,364,401
Members
400,800
Latest member
germanpbv

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top