Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim lastRow As Long
- Dim sheetRow As Long
- ' find the last rows that contains data in column A
- lastRow = Sheet1.Cells(Sheet1.Rows.Count, "A").End(xlUp).Row
- ' loop through the rows that have data
- For sheetRow = 1 To lastRow
- 'sets unideal court numbers from cell entry
- ' use the sheetrow variable to create the
- Unideal1 = Sheet1.Cells(sheetRow, "G").Value
- Unideal2 = Sheet1.Cells(sheetRow, "H").Value
- 'sets games from cell entry
- strGames = Sheet1.Cells(sheetRow, "B").Value
- 'sets court numbers from cell entry
- strCourts1 = Sheet1.Cells(sheetRow, "A").Value
- ' do the rest of your code ....
- ' you'll want to look at creating a sub procedure to pass these values into
- ' and have it do the work so that this loop isn't cluttered
- Next sheetRow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement