I have been working on vb for past few days..Its really interesting.But I wanna know how can we convert VB.net code to vba. A code which I wanna convert to VBA and run it as a macro. Please any help would be appreciative.
I have been working on vb for past few days..Its really interesting.But I wanna know how can we convert VB.net code to vba. A code which I wanna convert to VBA and run it as a macro. Please any help would be appreciative.
VB.NET provides far more functionality than VBA. Some code might be able to be translated as is, some might need a bit of tweaking and some might be all but impossible to replicate. It all depends on the specifics of the code.
2007-2013
Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs
MSDN "How Do I?" Videos: VB | C#
VBForums Database Development FAQ
My CodeBank Submissions: VB (*NEW* Match Two Game, *NEW* More Random Random Numbers) | C# (*NEW* Match Two Game, *NEW* More Random Random Numbers)
My Blog: Using Parameters in ADO.NET | Keyboard Events | Assemblies & Namespaces
Thanks..code is something like the below.
Code:Dim col As Integer = DGV.Columns.Count If col > 1 Then Dim start As Date = Date.Today.Add(New TimeSpan(0, 15, 0)) Dim end As Date = Date.Today.Add(New TimeSpan(11, 15, 0)) Dim cellV As String, cellD As Date For i As Integer = 1 To col - 1 For Each row As DataGridViewRow In DGV.Rows cellV = row.Cells(i).Value.ToString If Date.TryParse(cellV, cellD) Then If cellD > start AndAlso cellD < end Then row.Cells(i).Style.BackColor = Color.brown End If End If Next Next End If