The documentation is designed to help you to implement the features on your side. ByteScout Spreadsheet SDK was made to help with validate cell if value is in range in VB.NET. ByteScout Spreadsheet SDK is the library (SDK) that is capable of writing, reading, modifying and calculating Excel and CSV spreadsheets. Most popular formulas can be calculated and reculculated with Excel installed. You may import or export data to and from CSV, XML, JSON as well as to and from databases, arrays.
You will save a lot of time on writing and testing code as you may just take the code below and use it in your application. To do validate cell if value is in range in your VB.NET project or application you may simply copy & paste the code and then run your app! This basic programming language sample code for VB.NET will do the whole work for you in implementing validate cell if value is in range in your app.
ByteScout Spreadsheet SDK free trial version is available for download from our website. Free trial also includes programming tutorials along with source code samples.
Imports Bytescout.Spreadsheet Imports System.IO Module Module1 Sub Main() ' Create new Spreadsheet Dim document As Spreadsheet = New Spreadsheet() document.LoadFromFile("Data.xls") ' Get worksheet by name Dim worksheet As Worksheet = document.Workbook.Worksheets.ByName("Sample") ' Minimum age Dim RangeMin As Integer = 10 ' Maximum age Dim RangeMax As Integer = 19 ' Spellcheck words For i As Integer = 1 To 7 ' Set current cell Dim currentCell As Cell = worksheet.Cell(i, 1) ' Check current cell If System.Convert.ToInt32(currentCell.Value) < RangeMin Or System.Convert.ToInt32(currentCell.Value) > RangeMax Then ' Set fill pattern currentCell.FillPattern = Bytescout.Spreadsheet.Constants.PatternStyle.Solid ' Markup wrong cell by red color currentCell.FillPatternForeColor = System.Drawing.Color.Red End If Next ' remove output file if already exists If File.Exists("Output.xls") Then File.Delete("Output.xls") End If ' Save document document.SaveAs("Output.xls") ' Close Spreadsheet document.Close() ' open in default spreadsheets viewer/editor Process.Start("Output.xls") End Sub End Module