Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to do the following:
1. To read a cell in an excel file by finding the matching cell in one column
2. From there ( count) current row, set another search to find the next empty cell on an adjacent column
3. extract the array of cells found in those cells..
I can do 1 and 3 but i cant count function twice!!
SyntaxEditor Code Snippet
Dim Reference_File As String Reference_File = RuleArguments("Reference_File") '['Populate the Parameter from Excel File GoExcel.Open(Reference_File, "S Series" ) ' Define Range InitialRowStart = 1 InitialRowEnd = 200 For count = InitialRowStart To InitialRowEnd ' If it's blank count it If (GoExcel.CellValue("A" & count)) = ThisFileName Then Heading_Row_A = count 'MessageBox.Show(Current_Row_A, "Title") End If Next 'Make SUre that 40 is a number that adds to the current first row search, not too big not too small, ' As long as it covers all possibilities of finding a pipe FirstRangeRow = Heading_Row_A EndRangeRow = FirstRangeRow + 25 For count = FirstRangeRow To EndRangeRow ' If it's blank count it If String.IsNullOrEmpty(GoExcel.CellValue("B" & count)) Then i = i + 1 End If Next ' Next empty row is max rows minus blank row LastRow = EndRangeRow - i + 1 FirstRow = FirstRangeRow '] ' We get the lastRow and the firstrow to create arrays and search conditions'check if its correct MessageBox.Show(FirstRow, "First Row Number") MessageBox.Show(LastRow, "Last Row Number - Empty")
Solved! Go to Solution.